gpt4 book ai didi

c++ - C/C++ GetAsyncKeyState() 组合键

转载 作者:太空宇宙 更新时间:2023-11-04 15:54:02 26 4
gpt4 key购买 nike

我了解如何通过一个按键使用此功能,但我如何通过两个按键使用它?

像:GetAsyncKeyStat(VK_LBUTTON && VK_RBUTTON);

最佳答案

您必须调用 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;

关于c++ - C/C++ GetAsyncKeyState() 组合键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2800663/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com