Page 1 of 1

Mouse button pull down

Posted: 08 May 2021, 22:26
by AshMann
Hello! I am looking for a script that moves the mouse crosshair down at a steady rate when I hold down the left mouse button over half a second! Any help with this script would be great! I'm new to scripting and I'm trying it out on some processes!

Thanks!

Re: Mouse button pull down

Posted: 08 May 2021, 22:44
by boiler
Try this:

Code: Select all

Speed := 2

LButton::
	Click, Down
	KeyWait, LButton, T0.5
	if ErrorLevel {
		while GetKeyState("LButton", "P")
			MouseMove, 0, Speed, 0, R
	}
	Click, Up
return

Re: Mouse button pull down

Posted: 09 May 2021, 00:19
by AshMann
THANK YOU!!!

do you also know of a script where if I hold down the spacebar for more than half a second the spacebar get spammed until i let go of the spacebar

Re: Mouse button pull down

Posted: 09 May 2021, 01:04
by AshMann
@boiler

^^^^^^^^^^^^^^^^

Re: Mouse button pull down

Posted: 09 May 2021, 02:03
by AshMann
@boiler

also... is it possible to make it where it only goes down with both mouse clicks

Re: Mouse button pull down

Posted: 09 May 2021, 05:25
by boiler
Patience is a virtue...

Re: Mouse button pull down

Posted: 09 May 2021, 12:01
by boiler
AshMann wrote: do you also know of a script where if I hold down the spacebar for more than half a second the spacebar get spammed until i let go of the spacebar
Try this:

Code: Select all

$Space::
	Send, {Space}
	KeyWait, Space, T0.5
	if ErrorLevel
		while GetKeyState("Space", "P") {
			Send, {Space}
			Sleep, 50
		}
return

AshMann wrote: is it possible to make it where it only goes down with both mouse clicks
I don't know what you mean by this. Do you mean you want it to move the mouse pointer down only after a double-click and the button is held down after the second click?

Re: Mouse button pull down

Posted: 09 May 2021, 14:19
by AshMann
@boiler

I mean if I hold the RButton down AND the LButton down on the mouse at the same time... only then will the mouse move down until the buttons are released

Re: Mouse button pull down

Posted: 09 May 2021, 14:23
by boiler

Code: Select all

Speed := 2

LButton::
	Click, Down
	KeyWait, LButton, T0.5
	if ErrorLevel {
		while GetKeyState("LButton", "P") && GetKeyState("RButton", "P")
			MouseMove, 0, Speed, 0, R
	}
	KeyWait, LButton
	Click, Up
return
If you want it to move the mouse pointer without holding down the mouse button, you can remove the Click statements, but then the regular mouse button use won't work.