5

autohotkey 可以捕获非标准的鼠标按钮吗?我使用五键鼠标(Microsoft Wireless Laser Mouse 6000)。

4

3 回答 3

5

XButton1XButton2根据autohotkey.com上的文档。

于 2010-08-19T19:33:02.550 回答
4

以下 URL 显示了如何让自动热键记录所有键盘和鼠标事件,以及如何查看自动热键生成的这些事件的日志。

基于此,您可以通过创建这样的自动热键脚本来了解所有鼠标和键盘事件:

#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.

于 2010-08-20T17:05:55.837 回答
1

您需要捕获密钥的扫描码,然后使用它。您可以在此线程的第 5 篇文章中找到由 Skan 编写的脚本,该脚本将允许您执行此操作。只需运行它并使用您希望确定扫描码的鼠标按钮单击 GUI。然后在创建热键时使用扫描码代替普通键。

还有一种检索密钥的内置方法,该方法记录在本页底部的“特殊密钥”标题下。本质上,AHK 会记录您的按键操作并自动为您记录扫描码。

要将扫描码用作热键,您只需执行以下操作:

SC###:: ;Your code here

其中### 替换为您的键(或鼠标按钮)的代码。

于 2010-08-19T19:32:16.203 回答