Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default value for VK_CONTROL/VK_MENU/VK_SHIFT

We have 2 CTRL/ALT/SHIFT buttons on our keyboard. But there are VK_CONTROL/VK_LCONTROL/VK_RCONTROL available in the win api. So which value is default for the VK_CONTROL? VK_LCONTROL (left) or VK_RCONTROL (right)? Or maybe it choses value depending on some situation? Can't find the answer neither in MSDN nor in Google.

I think it doesn't matter in connection with CTRL - they are alternating, but it makes difference with e.g. ALT.

like image 526
tobi Avatar asked Jul 15 '12 12:07

tobi


2 Answers

Text from WinUser.h:

VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys.
Used only as parameters to GetAsyncKeyState() and GetKeyState().
No other API or message will distinguish left and right keys in this way.

like image 99
arx Avatar answered Nov 19 '22 23:11

arx


As far as I can tell these constants are declared in WinUser.h

#define VK_LSHIFT         0xA0
#define VK_RSHIFT         0xA1
#define VK_LCONTROL       0xA2
#define VK_RCONTROL       0xA3
#define VK_LMENU          0xA4
#define VK_RMENU          0xA5
like image 40
Blablablaster Avatar answered Nov 20 '22 00:11

Blablablaster