Code: Select all
SetMouseDelay -1,-1,-1
SetKeyDelay -1,-1,-1
SetDefaultMouseSpeed, 0
#maxhotkeysperinterval 99999
#MaxThreadsPerHotkey 3
PgUp::
#MaxThreadsPerHotkey 1
if KeepWinZRunning
{
KeepWinZRunning := false
return
}
; Otherwise:
KeepWinZRunning := true
Loop
{
Send, {Home}
Sleep, 2025
Send, {Ins}
Sleep, 2025
Send, {Del}
Sleep, 2025
if not KeepWinZRunning
break
}
KeepWinZRunning := false
return
After pressing Page Up a second time after starting the Loop the loop only breaks after running every send(home,ins,del) instead of breaking whenever I press Page Up.
Is there a way to stop the script as soon as my set key is pressed instead of only breaking after the whole loop finishes?
I know it can be done with if not GetKeyState() but i really don't want to be holding the key for the script to work.
[Mod edit: Topic name added]