Displaying 1 result from an estimated 1 matches for "kbdllhookstruct".
2009 Aug 06
1
WH_KEYBOARD_LL vs GetKeyState
...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->vkCode, key->scanCode, keyState, &chars, 0)) {
if((char)chars == '\r') putchar('\n');...