Hold to sprint.

Ask gaming related questions
Chaos5715
Posts: 7
Joined: 16 May 2020, 11:03

Hold to sprint.

Post by Chaos5715 » 16 May 2020, 14:59

I made this to enable sprint toggle on short press and hold to sprint on long press. In a toggle sprint only game.

Code: Select all

~$LShift::
	Send {LShift down}
KeyWait, LShift, T1    	
If ErrorLevel
{
	sleep, 50
	Send {LShift up}
	sleep, 50
	KeyWait, LShift
	sleep, 50
	Send {LShift down}
	sleep, 50
	Send {LShift up}
	sleep, 50
}
Else
	Send {LShift up}
Return
However, I'm curious if there is a way to occasionally inject a down press or something to reactivate sprint if it gets interrupted by something like walking into a wall. Something like, loop until...

Code: Select all

~$LShift::
	Send {LShift down}
KeyWait, LShift, T1    	
If ErrorLevel
{
	sleep, 50
	Loop, Send {LShift down}
	sleep, 500
	Until, KeyWait, LShift
	sleep, 50
	Send {LShift up}
	sleep, 50
	Send {LShift down}
	sleep, 50
	Send {LShift up}
	sleep, 50
}
Else
	Send {LShift up}
Return

Return to “Gaming”