AutoHotKey keystroke break loop
Using AutoHotKey, I have a rather simple loop script that I want to be able to break by the stroke of a key. I tried a few different codes from websites but it doesn't seem to work. Here's the code: #g:: Loop 20 { MouseClick, left, 142, 542 Sleep, 1000 MouseClick, left, 138, 567 Sleep, 1500 MouseClick, left, 97, 538 Sleep, 1000 } Use a global variable (keepCycling) and toggle it to break the loop. Global variables should be declared in the beginning of a script. Adding a global variable might be the easiest solution for your case since your loop takes a while to complete. global break_g = 0 #b