Emulate middle mouse button with AutoHotKey

I would like to write a simple script (one-liner?) to map the left shift + right mouse button to the middle mouse button (I don't actually have a middle mouse button, as it is a trackpad).

I have tried variations of this:

#(LShift & RButton)::MButton

or

(LShift & RButton::MButton

or

LShift & RButton::MButton

always with the error Error: Invalid Hotkey. I came here through the somewhat less specific question: Emulate middle mouse click on a two button mouse in Windows 7


Solution 1:

You can use <+RButton::MButton to get what you want.

I'm not sure why your last line didn't work though. But <+ is a shortcut for left shift, and apparently Autohotkey prefers it.