Mouse button pull down

Ask gaming related questions (AHK v1.1 and older)
AshMann
Posts: 15
Joined: 29 Apr 2021, 03:21

Mouse button pull down

08 May 2021, 22:26

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!
Last edited by gregster on 08 May 2021, 22:30, edited 1 time in total.
Reason: Topic moved to 'Ask For Help > ...'.
User avatar
boiler
Posts: 16903
Joined: 21 Dec 2014, 02:44

Re: Mouse button pull down

08 May 2021, 22:44

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
AshMann
Posts: 15
Joined: 29 Apr 2021, 03:21

Re: Mouse button pull down

09 May 2021, 00:19

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
Last edited by AshMann on 09 May 2021, 01:45, edited 1 time in total.
AshMann
Posts: 15
Joined: 29 Apr 2021, 03:21

Re: Mouse button pull down

09 May 2021, 01:04

@boiler

^^^^^^^^^^^^^^^^
AshMann
Posts: 15
Joined: 29 Apr 2021, 03:21

Re: Mouse button pull down

09 May 2021, 02:03

@boiler

also... is it possible to make it where it only goes down with both mouse clicks
User avatar
boiler
Posts: 16903
Joined: 21 Dec 2014, 02:44

Re: Mouse button pull down

09 May 2021, 05:25

Patience is a virtue...
User avatar
boiler
Posts: 16903
Joined: 21 Dec 2014, 02:44

Re: Mouse button pull down

09 May 2021, 12:01

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?
AshMann
Posts: 15
Joined: 29 Apr 2021, 03:21

Re: Mouse button pull down

09 May 2021, 14:19

@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
User avatar
boiler
Posts: 16903
Joined: 21 Dec 2014, 02:44

Re: Mouse button pull down

09 May 2021, 14:23

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.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 44 guests