A Low-Level Global Keyboard Hook runs on a separate thread.
Events
| Name |
|---|
| KeyDown |
| KeyUp |
| KeyPressed |
Methods
| Name |
|---|
| Start |
| Stop |
| Dispose |
Example
1 | GlobalKeyboardHook hook = new GlobalKeyboardHook(); |
Since the GlobalKeyboardHook operates on a different thread, you’ll need to update the UI in the KeyDown/KeyUp/KeyPressed events via a DispatcherQueue. Failing to do so will result in an exception.
Demo
you can run demo and see this feature.