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.
我用它来制作全局键盘钩子。有这样的行:
gkh.HookedKeys.Add(Keys.A); gkh.HookedKeys.Add(Keys.B);
注册挂钩的热键。如何修改该解决方案以制作组合挂钩,例如 A+B,但不是单个 A 或 B?
全局热键的标准解决方案是RegisterHotkeyAPI。它支持开箱即用的带有修饰符(Control、Shift、Alt、Windows)的热键,并且不会受到挂钩的全局副作用的影响。
RegisterHotkey