autohotkey 可以捕获非标准的鼠标按钮吗?我使用五键鼠标(Microsoft Wireless Laser Mouse 6000)。
3 回答
XButton1
并XButton2
根据autohotkey.com上的文档。
以下 URL 显示了如何让自动热键记录所有键盘和鼠标事件,以及如何查看自动热键生成的这些事件的日志。
- http://www.autohotkey.com/docs/commands/_InstallMouseHook.htm
- http://www.autohotkey.com/docs/KeyList.htm#SpecialKeys(特殊键部分)
基于此,您可以通过创建这样的自动热键脚本来了解所有鼠标和键盘事件:
#InstallKeybdHook
#InstallMouseHook
运行脚本后,您可以双击该脚本的托盘图标,然后转到查看>键历史记录和脚本信息 (Ctrl K)
Based on this information, I figured out that my mouse driver is already redefining the extra mouse buttons to other keys. However, I can re-map those keys by going to Control Panel > Mouse, selecting the desired button, and using the "Macro..." option in the mouse configuration (this is a special configuration only for the Microsoft Wireless Laser Mouse 6000 v2). In the macro dialog, I can define keystrokes for those mouse buttons to send (only one per mouse button). Next, I can use AutoHotkey to watch for whatever keystrokes I have defined, and perform specific actions based on those keystrokes.