Virtual-Key Problem

0 Franz Schmidt · September 27, 2014
Have got a little problem with my VKs here:

DWORD FetchKeyCode(){
DWORD i = 0x00;
DWORD ret = 0x00;
do{
i = 0x00;
ret = 0x00;
do
{
if (GetAsyncKeyState(i) & 0x1)
ret = i;
i++;
} while (!ret && i < 0xFF);
if (ret != 0){
return ret;
}
} while (1);
}

This function is used to detect the virtual key of a keyboard key.
The code works fine, but the problem I have is, that my left control key (VK_LCONTROL) has the same value as my alt gr key (VK_RMENU).
The VK_LCONTROL value is correct ((Hex)0xA2 or (Dec)162), but the VK_RMENU is false (needs to be (Hex)0xA5 or (Dec)165) according to this site and every other site I searched for.
http://quickmacros.com/help/Tables/IDP_VIRTUALKEYS.html

Why is this so? Is this only on my keyboard or is it a failure of the operationg system?
And how can I change the vk of alt gr or change the value of any vk?!?

Hope someone can help me:ermm:

Post a Reply

Replies

Oldest  Newest  Rating
0 Franz Schmidt · September 29, 2014
Thanks Gesu
  • 1

C++

107,222 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator