为什么GetAsyncKeyState无法判断键盘弹起???
我的系统是xpsp3的,
我像通过GetAsyncKeyState判断键盘弹起,如下,
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
SHORT aa= GetAsyncKeyState(VK_SHIFT);
SHORT bb = aa&0x8000;
if (aa && !bb)
{
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
我在return TRUE;这里下断点,
网上好像普遍都是if(bb),我测试的时候这样即使不按任何键也都会断下,
然后我试着用if (aa && !bb),但是根本就断不下来,
有没有人知道为什么?