TO: yarshray(saga jion) 什么逻辑值? 如果ctrl被按下,GetAsyncKeyState( VK_CONTROL )的返回值是-32786.
if ((GetAsyncKeyState( VK_CONTROL ) & 0x8000) != 0) { //down }see http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/getasynckeystate.asp?frame=true If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Res.
什么逻辑值?
如果ctrl被按下,GetAsyncKeyState( VK_CONTROL )的返回值是-32786.
{
//down
}see
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/getasynckeystate.asp?frame=true
If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Res.
非常感谢!
0x8000是个什么意思?
表示 Int16 的最小可能值。此字段为常数,常数的值为 -32768;即十六进制的 0x8000