0
votes

I need a script where if I hold down XButton1 in my mouse, it auto clicks for me until I release.

I was able to find this script: F1::Click % GetKeyState("LButton") ? "Up" : "Down" but when I change F1 to XButton1 it doesn't seem to hold down like it does with F1.

1

1 Answers

0
votes

It appears to only send a left-click down/up once. I think this happens because keypresses and mouse clicks behave differently in that when you hold a key you expect it to repeat after a short delay, whereas if you hold a mouse button you expect it to just stay held and not repeatedly click. Since the XButtons are mouse buttons, they will behave as such, even though the intuitive expected behavior is that of a keypress. Anyway, that aside, we'll just have to make the script longer.

XButton1 Up::bT := false
XButton1::
bT := true
While( bT )
{
    Click
    Sleep , 50 ; Added sleep to make it a bit more stable (add more if needed)
}
Return