XButton1/2 作为全局热键

发布于 2024-09-07 12:01:31 字数 325 浏览 2 评论 0原文

我最近偶然发现了一个全局热键类(这个),它工作得很好,正是我所需要的。

但我遇到了一个问题,由于某种原因,它不适用于鼠标按钮 XButton1 和 XButton2。

所以我想问,是否有任何方法可以使其发挥作用,或者是否有一个合乎逻辑的解释为什么它不起作用。

哦,我认为 XButton 还没有绑定全局热键。

提前致谢
- 卡斯帕

I recently stumbled upon a global hotkey class (This one), it works very well and was just what i needed.

But i ran into an issue with it, for some reason it doesn't work with the mouse buttons XButton1 and XButton2.

So i would like to ask, if there's any way to make it work, or if there's a logical explanation as of why it won't work.

Oh, and i don't think there already is a global hotkey bound to the XButtons.

Thanks in advance
- Casper

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别忘他 2024-09-14 12:01:31

我没有看到该类的任何代码。但几乎可以肯定它使用了 RegisterHotKey() API 函数。它适用于键盘按键,不适用于鼠标按钮。要全局捕获鼠标按钮事件,您需要使用 SetWindowsHookEx,使用 WH_MOUSE_LL 挂钩。谷歌搜索得很好,你会发现很多例子。

I don't see any code for that class. But it almost certainly uses the RegisterHotKey() API function. Which works for keyboard keys, not mouse buttons. To globally trap mouse button events you need to use SetWindowsHookEx, using a WH_MOUSE_LL hook. That googles really well, you'll find many examples.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文