Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在用
public static bool IsKeyPushedDown(Keys vKey) { return 0 != (GetAsyncKeyState((int)vKey) & 0x8000); }
但我不知道如何组合 2 个键。
可能是什么if (IsKeyPushedDown('B') && IskeyPushedDown(VK_CONTROL))?
if (IsKeyPushedDown('B') && IskeyPushedDown(VK_CONTROL))
正如其他人在评论中所说,使用事件 WM_KEYDOWN 或 WM_CHAR 来检查“有人按下了一个键”确实是“我想在有人按下一个键时调用一个函数”的“正确”解决方案。但是,您特别问“我正在使用..一些代码..我不知道如何组合 2 个键”,以上绝对是正确的答案。