How would I detect every key press without listing out every key code from start to finish and not limiting the usable keys to special keys?
I want to create a function which detects a keypress and get the keycode of said key.
Pseudo:
1 2 3 4 5 6 7 8
Program Start
keypress == user presses key
var hotkey == keypress
while ( true )
{
if(user presses hotkey)
you presses the hotkey!
}
I want to make a program that does what's above ^ with any pressable key eg: User presses K the hotkey can be K doesn't have to be restricted to F1-12 and other special keys.
I can not think of a way to do this other than making a switch statement with a case for all 70+ keys that would be over 200+ lines (estimating) of code which I'd rather not right out if I don't have to.
Never mind I've figured out how to do it. I thought Keyboard Hooks would be harder, but it turns out they're much simpler! The KBDLLHOOK* structure actually stores the vkCode of pressed keys.