Пример #1
0
 void keyboardHook_GlobalKeyDown(KeyboardHook sender, KeyboardHook.KeyEventArgsExt e)
 {
     e.Handled = true;
     if (this.InvokeRequired)
     {
         this.BeginInvoke((KeyboardHook.KeyEventHandlerExt)keyboardHook_GlobalKeyDown, sender, e);
     }
     else
     {
         this.key                         = e.KeyCode;
         this.scancode                    = e.Scancode;
         this.keyboardHook.Enabled        = true;
         this.keyboardHook.GlobalKeyDown -= new KeyboardHook.KeyEventHandlerExt(keyboardHook_GlobalKeyDown);
         this.DialogResult                = System.Windows.Forms.DialogResult.OK;
         this.Close();
     }
 }
 internal KeyboardDoublePressDetector(KeyboardHook kbdHook)
 {
     this.keyboardHook = kbdHook;
 }