I hit the assigned toggle key again to pause. But the problem is that I have to wait for the function "Hit 4" to terminate before it completely stops.
Is there a way to pause the function immediately after a keystroke, without having to wait for the whole "Hit 4" to finish? I don't want to pause the whole script, just this function.
Thanks
Code: Select all
NumpadEnter::
if (HitToggle4 := !HitToggle4){
SetTimer, Hit4, 12250
GoSub, Hit4
} else {
SetTimer, Hit4, Off
}
return
Hit4:
WinActivate, NotePad
sleep 4000
WinActivate, Exploer
sleep 4000
WinActivate, PowerPoint
sleep 4000
return