I use the Raw Input API because I need to be able to respond to keys from another USB HID device differently, even if it is the same key.
The correct messages are in my window WM_INPUT. I can get the structure RAWKEYBOARDto get all the necessary information.
Now I want these USB devices to not be able to switch from NumLock. I hope that the Raw Input API can let me learn NumLock clicks?
Ive tried setting the WM_INPUT messages to Result 1, but that doesn't seem to have an effect.
(I write this in C #, but since this is all a low-level Windows API, you probably don't need to know C # or .NET to answer this question.)
EDIT: Oh yes, I also tried using the global keyboard hook ( SetWindowsHookEx) to learn pressing NumLock. Unfortunately, as soon as I initialize the Raw Input API, the global keyboard hook is no longer called while the window is active. Ive also tried to set a global hook after Raw Input, but the same effect.
Timwi source
share