Esempio n. 1
0
 private int HookCallback(int code, IntPtr wParam, ref KeyboardHook.KBDLLHOOKSTRUCT lParam)
 {
     if (code < 0)
     {
         return KeyboardHook.CallNextHookEx(this._hookHandle, code, wParam, ref lParam);
     }
     if ((lParam.flags & 128u) != 0u && this.KeyUp != null)
     {
         this.KeyUp(this, new HookEventArgs(lParam.vkCode));
     }
     if ((lParam.flags & 128u) == 0u && this.KeyDown != null)
     {
         this.KeyDown(this, new HookEventArgs(lParam.vkCode));
     }
     return KeyboardHook.CallNextHookEx(this._hookHandle, code, wParam, ref lParam);
 }
Esempio n. 2
0
 private static extern int CallNextHookEx(IntPtr hook, int code, IntPtr wParam, ref KeyboardHook.KBDLLHOOKSTRUCT lParam);
Esempio n. 3
0
 private static extern IntPtr SetWindowsHookEx(KeyboardHook.HookType code, KeyboardHook.HookProc func, IntPtr instance, int threadID);
Esempio n. 4
0
 public App()
 {
     this.hook = new KeyboardHook();
     this.hook.KeyDown += new KeyboardHook.HookEventHandler(this.OnHookKeyDown);
 }