Hey everyone! I'm havin a bit of trouble with my virtual-key codes. On MSDN it says that you can use VK_A - VK_Z, but whenever I try, it says that VK_(whatever letter) is an undeclared identifier. What am I missing?
Printable View
Hey everyone! I'm havin a bit of trouble with my virtual-key codes. On MSDN it says that you can use VK_A - VK_Z, but whenever I try, it says that VK_(whatever letter) is an undeclared identifier. What am I missing?
#include <windows.h>? :)
I do not believe VK_*letter* exist. You can use static_cast<char>(...) and compare it to whatever letter you want.
Kuphryn
Ken,
2 troo :(Quote:
-KEN-
Unimaginative.
Kuphryn,
Thanks! (actually, I don't need it anymore 'cuz I ditched my original idea in favour of a dialog box :D)
The virtual key codes for letters and numbers are the same as the ASCII key codes.
Just use 'A' when you want VK_A.
Okee, gotcha. That's pretty much what I do anyways, but why don't VK_ letters work?
i had the same problem so i just used the hex
:) I remember trying that and it not working... probably made a mistake tho.
>>but why don't VK_ letters work?
I could not find a #define for them as I could for the other VK_'s.
The comment next to VK_'s defines was to use the ASCII codes.
I just made my own header file:D. I've attached it to this post...
:D I don't think that'll be necessary. Ascii codes work fine for me!
BTW, I brought up the subject 'cuz I wanted to use GetKeyboardState(), but I couldn't figure out which key was pressed :( (and I wanted to figure it out, so I could have the user type in a message :) That won't be necessary, since I've gone with a dialog box instead.)