I’m writing a program with visual C++ that should change some keyboard keys in a game.
I used
kHook = SetWindowsHookEx(WH_KEYBOARD_LL,setkey,NULL,0);
to know the keys are pressed in computer and
FindWindow()
to find the game that I should process my code to get the keys are pressed in that game.
But I need to disable some keys for example when space is clicked I need to prevent the game to know space is clicked. Actually disable space in that game what should I do. I searched a lot but I got nothing.
Please read carefully LowLevelKeyboardProc callback function MSDN documentation. There are answers.
Basically you need in your
LowLevelKeyboardProcimplementation (setkey?):wParamforWM_KEYDOWNandWM_KEYUPmessagesvkCodefrom structure pointed bylParamforVK_SPACE