GetAsyncKeyState(???)
i usual use GetAsyncKeyState(VK_UP) and the other virtual key codes when i want to use the arrow keys or check to see if the escape button has been pressed. but for my new game i want to check if the letters z, x, p, n, or q have been pressed. i have found VK_LIST but can't find what i would put in the GetAsyncKeyState function to check whether or not a letter has been pressed. does anybody know the key code i need and syntax to use to complete this task? thanks.
[edited by - drewsmug on May 9, 2004 3:59:23 PM]
This goes like this. For example
To check ''a'' letter you can put:
if (GetAsyncKeyState(''A'') & 0x8000f)
// Do something
Cya
To check ''a'' letter you can put:
if (GetAsyncKeyState(''A'') & 0x8000f)
// Do something
Cya
GetAsyncKeyState( ''A'' )
GetAsyncKeyState( ''5'' )
etc.
For the keys that don''t have a VK_* symbol, you can just use their character. For letters, I believe you have to use the uppercase.
GetAsyncKeyState( ''5'' )
etc.
For the keys that don''t have a VK_* symbol, you can just use their character. For letters, I believe you have to use the uppercase.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement