C / C ++ GetAsyncKeyState()组合键 [英] C/C++ GetAsyncKeyState() Key combination

查看:861
本文介绍了C / C ++ GetAsyncKeyState()组合键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用这项功能一键,但我怎么能有两个关键presses使用它?

I understand how to use this function with one key, but how can I use it with two keypresses?

我爱:GetAsyncKeyStat(VK_LBUTTON&安培;&安培; VK_RBUTTON);

Like: 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 ++ GetAsyncKeyState()组合键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆