private void OnKeyboardHookEvent(object sender, KeyboardHookedEventArgs e)
 {
     if (e.UpDown == KeyboardUpDown.Down)
     {
         _pressedKeysConcurrent.Enqueue(e.KeyCode.ToString());
     }
 }
Beispiel #2
0
 private int CallNextHook(int code, KeyboardMessage message, ref KeyboardState state)
 {
     if (code >= 0)
     {
         KeyboardHookedEventArgs e = new KeyboardHookedEventArgs(message, ref state);
         OnKeyboardHooked(e);
         if (e.Cancel)
         {
             return(-1);
         }
     }
     return(CallNextHookEx(IntPtr.Zero, code, message, ref state));
 }
Beispiel #3
0
 ///<summary>
 ///KeyboardHookedイベントを発生させる。
 ///</summary>
 ///<param name="e">イベントのデータ。</param>
 protected virtual void OnKeyboardHooked(KeyboardHookedEventArgs e)
 {
     (Events[EventKeyboardHooked] as KeyboardHookedEventHandler)?.Invoke(this, e);
 }