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?
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?
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
#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-KEN-
Unimaginative.
Kuphryn,
Thanks! (actually, I don't need it anymore 'cuz I ditched my original idea in favour of a dialog box )
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
The virtual key codes for letters and numbers are the same as the ASCII key codes.
Just use 'A' when you want VK_A.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Okee, gotcha. That's pretty much what I do anyways, but why don't VK_ letters work?
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
i had the same problem so i just used the hex
In a perfect world every dog would have a home and every home would have a dog.
Visit My Web Site, Canine Programming
I use Win32 API
I remember trying that and it not working... probably made a mistake tho.
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.
>>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.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
I just made my own header file. I've attached it to this post...
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.)
Just Google It. √
(\ /)
( . .)
c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.