Hello
Quick question:
GetKeyState(VK_SHIFT) works. Some don't work (like the virtual key VK_SPACE) for some reason. To detect ENTER instead of 'a', I use GetKeyState(VK_RETURN), which works.Code:while(1){ if(GetKeyState(VK_SHIFT)<0){ //if SHIFT pressed cout<<"control "<<endl; if(GetKeyState('a')<0){ //if SHIFT is still being pressed and then 'a' is pressed too cout<<"a"<<endl; } } else{ //if no keys are pressed cout<<"No key being pressed"<<endl; } }
Is there an easy way to assign a virtual key tag to nonvirtual keys like characters, numbers, and so on?
Compiler: Dev C++
Would it understand GetKeyState('a') as being a character key press of 'a' if I compiled it with Visual C++?
I did check out the table here. I tried the codes for the capital letters, the top numbers, and the numpad, but none worked.
I checked out ASCII tables (writing decimal 97 or hex 0x61 in place of 'a'), but those didn't work either.
Thanks in advance!