Example #1
0
 protected virtual void OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo)
 {
     if (HookEvent != null)
        {
        HookEvent(hookArgs, keyBoardInfo);
        }
 }
Example #2
0
 public void HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo)
 {
     _globalkey = keyBoardInfo;  //  Отсалось для проверки
     _globalArgs = e;            //  Отсалось для проверки
     _mediaPlayer.HardwareKeys(keyBoardInfo);
 }
Example #3
0
        private int HookProcedure(int code, IntPtr wParam, IntPtr lParam)
        {
            KBDLLHOOKSTRUCT hookStruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT));
               if (code < 0)
               return CallNextHookEx(hookDeleg, code, wParam, lParam);
               // Let clients determine what to do
               HookEventArgs e = new HookEventArgs();
               e.Code = code;
               e.wParam = wParam;
               e.lParam = lParam;

               KeyBoardInfo keyInfo = new KeyBoardInfo();
               keyInfo.vkCode = hookStruct.vkCode;
               keyInfo.scanCode = hookStruct.scanCode;
               OnHookEvent(e, keyInfo);
               // Yield to the next hook in the chain
               return CallNextHookEx(hookDeleg, code, wParam, lParam);
        }