Back\forward buttons long pressed to act as crtl/alt & left/right

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sulphuricsaliva
Posts: 48
Joined: 11 Sep 2018, 12:37

Back\forward buttons long pressed to act as crtl/alt & left/right

16 Apr 2022, 10:59

Hello, like the title says, I need my left and right mouse buttons to act like left arrow and right arrow (which is easy) but I want to be able to long press them so they become ctrl and alt (as if I was long pressing control and/or alt on my keyboard). This is what I have, It's not working.
$*XButton2::
Send {Blind}{right}
KeyWait, XButton2, T0.4
If ErrorLevel {
Send {control}
KeyWait, XButton2
}
return
I know It's probably because It's not supposed to be sending {control} but I can't find an alternate solution. Little help please? I need to have a lot of control options with mouse button combos. Cheers.
User avatar
mikeyww
Posts: 27372
Joined: 09 Sep 2014, 18:38

Re: Back\forward buttons long pressed to act as crtl/alt & left/right

16 Apr 2022, 11:43

Code: Select all

LButton::
KeyWait, LButton, T.3
If ErrorLevel {
 Send {Ctrl down}
 SoundBeep, 1500
 KeyWait, LButton
 Send {Ctrl up}
} Else Send {Left}
Return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk and 354 guests