Sign in to follow this  

probloms with keys...

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 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this