keyboard input
I''m using the following macros from a Lamothe book:
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEY_UP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
These work on all keys like ctrl, home, shift, end, return, etc., but when I try something like:
KEY_DOWN(VK_P);
I get the error:
error C2065: ''VK_122'' : undeclared identifier
How do I use the alphanumeric keys to test for input?
I forgot to mention Im using VC++6 and DirectX 7.0. I intend to use DIrectInput in the future, but until then, I''d like to get by with these macros. Thanks for your help.
I''m not 100% for certain, but I believe Lamothe mentions that there are not any VK_ constants defined for the alphabetical keys, so I don''t think there is a VK_P defined. Also, I don''t believe there are VK_ constants defined for the keys 0-9 either.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement