0
2
|
What is the difference between MK_CONTROL and VK_CONTROL in Win32 API? Firstly, I checked the defined values. MK_CONTROL : 0x0008 VK_CONTROL : 0x11 Secondly, I tested in my simple code like this.
Does wParam value depend on the state of mouse device? What is the difference between MK_.. and VK_.. thing? |
|
VK_CONTROL is the virtual key number for the Ctrl key. It is only valid in keyboard messages like WM_KEYDOWN. MK_CONTROL is only valid in mouse messages, it is flag that indicates that the Ctrl key was down when the message was generated. It helps you to detect, say, the user holding down the Ctrl key while clicking. Ctrl+Click is used to expand selections. –
Hans Passant
Dec 27 '14 at 13:05
| ||
|
用&与用==的区别
1.
用&是为了取ML_CONTROL的那一个位。仅判断那个位是1,也就是说 只要按下了CONTROL键,可能是单按了CONTROL,也可能是CTRL+ALT、CTRL+SHIFT等等。VK是虚拟键值;ML是用来相应WM_KEYDOWN等消息的
2.单按control键:wparam==VK_CONTROL
含有control键的组合键:wparam==VK_CONTROL不成立,但wparam&MK_CONTROL成立