Jump to content
  • Advertisement
Sign in to follow this  

probloms with keys...

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

hello all i am trying to make a program which needs to get some informashion by pressing some keys on the keyboard. some of them i found like VK_UP but i cant find the '+' and '-' but the ones which are near the ')' and they are above 'p' can anyone help me with this? thanks in advance

Share this post

Link to post
Share on other sites
If you look in your standard include directory you should have a file named "winuser.h", that will list all of the defined virtual key codes. For keys like the standard alphanumeric ones ('A', 'B', '0', '1' etc) you would use something like:
static_cast<int>('KEY NAME GOES IN HERE')
So to use the '+' and '-' keys (on my english keyboard) I would use:
// '+' key
// '-' key
As the codes are just their ASCII equivalent, you could go to a site such as www.lookuptables.com and just find the actual numeric code for that key and use that, e.g:
// '+' key = 43 decimal
// '-' key = 45 decimal

Hope that helps you [smile].

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!