예제 #1
0
 bool hook_HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo)
 {
     if (keyBoardInfo.vkCode == 117)
     {
         if (e.wParam == volumeUp)
         {
             MainMap.Zoom = (int)(MainMap.Zoom) + 1;
         }
     }
     else if (keyBoardInfo.vkCode == 118)
     {
         if (e.wParam == volumeUp)
         {
             MainMap.Zoom = (int)(MainMap.Zoom) - 1;
         }
     }
     return(true);
 }
예제 #2
0
 private int HookProcedure(int code, IntPtr wParam, IntPtr lParam)
 {
    KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT) Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
    if(code >= 0)
    {
       HookEventArgs hookArgs = new HookEventArgs();
       hookArgs.Code = code;
       hookArgs.wParam = wParam;
       hookArgs.lParam = lParam;
       KeyBoardInfo keyBoardInfo = new KeyBoardInfo();
       keyBoardInfo.vkCode = kbdllhookstruct.vkCode;
       keyBoardInfo.scanCode = kbdllhookstruct.scanCode;
       if(this.OnHookEvent(hookArgs, keyBoardInfo))
       {
          return 1;
       }
    }
    return CallNextHookEx(this.hookDeleg, code, wParam, lParam);
 }
예제 #3
0
        private int HookProcedure(int code, IntPtr wParam, IntPtr lParam)
        {
            KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));

            if (code >= 0)
            {
                HookEventArgs hookArgs = new HookEventArgs();
                hookArgs.Code   = code;
                hookArgs.wParam = wParam;
                hookArgs.lParam = lParam;
                KeyBoardInfo keyBoardInfo = new KeyBoardInfo();
                keyBoardInfo.vkCode   = kbdllhookstruct.vkCode;
                keyBoardInfo.scanCode = kbdllhookstruct.scanCode;
                if (this.OnHookEvent(hookArgs, keyBoardInfo))
                {
                    return(1);
                }
            }
            return(CallNextHookEx(this.hookDeleg, code, wParam, lParam));
        }
예제 #4
0
 bool hook_HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo)
 {
     if(keyBoardInfo.vkCode == 117)
      {
     if(e.wParam == volumeUp)
     {
        MainMap.Zoom = (int) (MainMap.Zoom) + 1;
     }
      }
      else if(keyBoardInfo.vkCode == 118)
      {
     if(e.wParam == volumeUp)
     {
        MainMap.Zoom = (int) (MainMap.Zoom) - 1;
     }
      }
      return true;
 }
예제 #5
0
 protected virtual bool OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo)
 {
    return ((this.HookEvent != null) && this.HookEvent(hookArgs, keyBoardInfo));
 }
예제 #6
0
 protected virtual bool OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo)
 {
     return((this.HookEvent != null) && this.HookEvent(hookArgs, keyBoardInfo));
 }