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.

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 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:
// '+' keystatic_cast<int>('+')// '-' keystatic_cast<int>('-')
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 on other sites
i'm trying to understand what to i have to write in
keys[]
for those ?

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• Forum Statistics

• Total Topics
631425
• Total Posts
3000011
×