例如,按TAB将关闭/打开此循环:
Loop
{ ;loop start
GetKeyState, var, LButton, P
If var = U
Break
Send {1}
Random, r, 100, 400
sleep r
}
return
这可能吗?
答案 0 :(得分:0)
Settimer, MyLabel, 10
Tab::
Settimer, MyLabel, % (t:=!t)?"On":"Off"
Return
MyLabel::
GetKeyState, var, LButton, P
If var = U
Settimer,, Off
Send {1}
Random, r, 100, 400
sleep r
return
答案 1 :(得分:0)
或者这个:
Tab:: toggle := !toggle
#If toggle
~LButton::
while GetKeyState("LButton")
{
Send {1}
Random, r, 100, 400
sleep r
}
return
#If