search for: lowlevelkeyboardproc

Displaying 1 result from an estimated 1 matches for "lowlevelkeyboardproc".

2009 Aug 06
1
WH_KEYBOARD_LL vs GetKeyState
...> * input, it won't get the new key state. So ResyncKeyState() will > * ensure that if the app is looping on GetKeyState(), it'll get the > * right key state. > */ Code: #include <windows.h> #include <cstdio> LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { if(nCode == HC_ACTION && wParam == WM_KEYDOWN) { KBDLLHOOKSTRUCT* key = (KBDLLHOOKSTRUCT*)lParam; GetKeyState(0); BYTE keyState[256]; GetKeyboardState(keyState); WORD chars; if(ToAscii(key-&g...