Mapping two keys to one mouse button

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Raijin
Posts: 2
Joined: 25 Jun 2022, 09:36

Mapping two keys to one mouse button

Post by Raijin » 25 Jun 2022, 09:39

Hi,

I'm trying to map the 'e' and 's' keys to XButton4 so that when I hold it down 'e' and 's' are also held down.

I'm able to map one of the keys using XButton1::s but I can't figure out how to map multiple keys.

Any help would be very much appreciated!

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Mapping two keys to one mouse button

Post by mikeyww » 25 Jun 2022, 10:52

AHK supports the wheel and five mouse buttons as follows. https://www.autohotkey.com/docs/KeyList.htm#mouse-general

Raijin
Posts: 2
Joined: 25 Jun 2022, 09:36

Re: Mapping two keys to one mouse button

Post by Raijin » 25 Jun 2022, 12:27

Thank you but I'm still not sure how to map Xbutton1 (Mouse 4) to more than one key. I can map it so Mouse 4 becomes the 's' key like so

Code: Select all

Xbutton1::s
s::Xbutton1
But I don't know how to make it so that Mouse 4 presses both 's' and 'e' keys at the same time.

User avatar
mikeyww
Posts: 26889
Joined: 09 Sep 2014, 18:38

Re: Mapping two keys to one mouse button

Post by mikeyww » 25 Jun 2022, 12:58

Code: Select all

XButton1::Send {e down}{s down}
XButton1 Up::
Send {s up}{e up}
SoundBeep, 1500
Return

Post Reply

Return to “Ask for Help (v1)”