• Advertisement

Archived

This topic is now archived and is closed to further replies.

GetAsyncKeyState(???)

This topic is 5036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
This goes like this. For example

To check ''a'' letter you can put:

if (GetAsyncKeyState(''A'') & 0x8000f)
// Do something


Cya

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement