Autohotkey - captures additional mouse buttons

Can autohotkey capture non-standard mouse buttons? I am using a five-button mouse (Microsoft Wireless Laser Mouse 6000).

+4
source share
3 answers

The following URLs show how to have an autohotkey, log all keyboard and mouse events, and how to look at the log autohotkey generates these events.

Based on this, you can learn about all mouse and keyboard events by creating an autohotkey script as such:

#InstallKeybdHook #InstallMouseHook 

After running the script, you can double-click the tray icon for this script, then go to the "View Key History and Script Information (Ctrl K)

Based on this information, I found out that my mouse driver is already overriding additional mouse buttons to other keys. However, I can rearrange these keys by going to "Control Panel"> "Mouse", selecting the desired button and using the "Macro ..." parameter in the mouse configuration (this is a special configuration only for Microsoft Wireless Laser Mouse 6000 v2). In the macro dialog I can determine the keystrokes for these mouse buttons to send (only one per mouse button). Then I can use AutoHotkey to view any keystrokes that I defined and perform certain actions based on those keystrokes.

+2
source

XButton1 and XButton2 according to the documentation on autohotkey.com.

+4
source

You need to grab the scancode key and then use it. You can find the script in the 5th column of this thread , written by Skan, which will allow you to do this. Just run this and click on the graphical interface with the mouse button that you want to define scancode. Then use the scancode instead of the regular key when creating the hotkey.

There is also a built-in key extraction method, which is documented at the bottom of this page under the heading "Special keys". Essentially, AHK records keystrokes and automatically records scancodes for you.

To use scancode as a hotkey, you simply do the following:

 SC###:: ;Your code here 

Where ### is replaced by the code of your key (or mouse button).

+1
source

All Articles