Assigning Mouse Button as Modifier Key Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SerbySnacks
Posts: 2
Joined: 12 Mar 2021, 01:43

Assigning Mouse Button as Modifier Key

Post by SerbySnacks » 12 Mar 2021, 02:15

Hello all!

I've been using an extremely basic script to change a side mouse button to function as Shift.

Code: Select all

XButton1::LShift
This works most of the time, however if I try to make another script using Shift, I cannot use XButton1 as said Shift.

I'd like to use XButton1 & Wheelup/Wheeldown to HOLD SHIFT, and LEFT CLICK WITH EACH SCROLL
(Ex. Hold XButton1, scroll scroll scroll scroll, Release XButton1)

Listed below is the exact script I've messily thrown together to achieve this, but shift is stuck held down until pressed again. Not a huge problem, but I'd like to solve it!

Code: Select all

XButton1 & wheelup::
{
    Send {Shift down}
    Sleep 1
    Send {LButton}
}
return
XButton1 & wheeldown::
{
    Send {Shift down}
    Sleep 1
    Send {LButton}
}
return

Any help would be greatly appreciated!
Rohwedder
Posts: 7770
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Assigning Mouse Button as Modifier Key  Topic is solved

Post by Rohwedder » 12 Mar 2021, 03:17

Hallo,
untested (I have no XButtons):

Code: Select all

XButton1::LShift ;remaps XButton1 to LShift
~XButton1 & WheelUp:: ;sends LShift & LButton
~XButton1 & WheelDown::Send, {Blind}{LButton}
jj4156
Posts: 19
Joined: 17 Jun 2019, 07:03
Contact:

Re: Assigning Mouse Button as Modifier Key

Post by jj4156 » 12 Mar 2021, 07:55

'Key down' will switch 'key' to down statue and keep it. To switch key back, 'Key up' is needed to send after 'Key down'.
SerbySnacks
Posts: 2
Joined: 12 Mar 2021, 01:43

Re: Assigning Mouse Button as Modifier Key

Post by SerbySnacks » 12 Mar 2021, 21:15

Rohwedder wrote: Hallo,
untested (I have no XButtons):

Code: Select all

XButton1::LShift ;remaps XButton1 to LShift
~XButton1 & WheelUp:: ;sends LShift & LButton
~XButton1 & WheelDown::Send, {Blind}{LButton}
This works beautifully! Thank you!
I'll have to look into how Blind works now :D
Post Reply

Return to “Ask for Help (v1)”