Jump to content
  • Advertisement

Archived

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

Lalle

VK_B?

This topic is 6190 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

If I want to test if the space key is beeing pressed, I use the GetAsyncKeyState() function like this: if (GetAsyncKeyState((int) VK_SPACE)) //do something what do I have to change VK_SPACE to if I want to check if a letter is held down? ie. GetAsyncKeyState(VK_B) //this wont work thanks Lalle

Share this post


Link to post
Share on other sites
Advertisement
You use the value of a the uppercase character
eg
GetAsyncKeyState(''A'') // VK_A
GetAsyncKeyState(''B'') // VK_B
GetAsyncKeyState(''C'') // VK_C
...

with number keys its the same
GetAsyncKeyState(''1'') // VK_1
GetAsyncKeyState(''2'') // VK_2
GetAsyncKeyState(''3'') // VK_3
...

but its different with the num pad keys - I don''t remember
VK_NUM1 i think

Share this post


Link to post
Share on other sites
About the number pad keys, I''m pretty sure Windows treats them the same as the normal number keys when num lock is on, and the arrows keys when it is off.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!