1

I registered global hotkeys as described here in c# How do I detect keyPress while not focused?

but it just detects if the button is pressed, but I need to know when the key is pressed down and when it is released again.

Community
  • 1
  • 1
  • check this out: https://blogs.msdn.microsoft.com/toub/2006/05/03/low-level-keyboard-hook-in-c/ – Ofir Winegarten Apr 22 '17 at 06:01
  • That's not possible, the OS only turns the WM_KEYDOWN notification into a corresponding WM_HOTKEY notification. Nor would that be very practical since you typically activate another window. Hmm. You need a hook that sees everything, takes SetWindowsHookEx to set a low-level keyboard hook. Lots and lots of implementations in C#. – Hans Passant Apr 22 '17 at 06:24
  • In the question **YOU** linked, follow the Accepted Answer and use a low level keyboard hook via WH_KEYBOARD_LL. – Idle_Mind Apr 22 '17 at 06:29
  • you should listen to KeyUp event as well. – Abdullah Dibas Apr 22 '17 at 06:42

0 Answers0