autohotkey: finish loop only when all keys are sent
here's my ahk file, spam F5 + click (while hold):
开发者_如何学C$*F5::
Loop {
if not GetKeyState("F5", "P")
break
Send, {f5}
Click
}
how to make sure the loop only stops when CLICK is sent (after f5)? sometimes the loop is ending in the F5 and the click is not sent
thank you
Using click sends a click to the current mouse location, which might be away from the location you want. Make sure that the current mouse position is at the desired location. Try to add the following in your code to display current mouse position and active window.
CoordMode,Mouse,Screen
MouseGetPos,mpx,mpy
tooltip, mouseposition = %mpx%.%mpy%, 1,1
sleep 5000
WinGetTitle, windowTitle, A
tooltip, Active Window = %windowTitle%, 1,1
sleep 5000
try the following instead of Click
Send Click
does it work?
精彩评论