C/C++ GetAsyncKeyState() 组合键

0 c++ windows api

我知道如何通过一键使用此功能,但是如何通过两次按键使用它?

像:GetAsyncKeyStat(VK_LBUTTON && VK_RBUTTON);

Igo*_*aka 5

你将不得不打电话GetAsyncKeyState两次。

//"And" the returns of GetAsyncKeyState
//Then "and" the result with 0x8000 to get whether or not the Most Significant Bit is set
bool bBothPressed = GetAsyncKeyState(VK_LBUTTON) & GetAsyncKeyState(VK_RBUTTON) & 0x8000;
Run Code Online (Sandbox Code Playgroud)