我在网站上搜索了很多,但没有找到如何去做。 这是我当前的脚本:Autohotkey:按一定的快捷键结束循环
MButton::
MouseGetPos, xpos, ypos
Sleep, 50
Click
Loop
{
Sleep 50
Send, {\ down}
Sleep 50
Send, {\ up}
}
Click %xpos%, %ypos%, 0
Return
我想通过按下鼠标(MButton)的中间按钮来结束循环。 我认为不是一件困难的事情,但找不到它,你能非常感谢
编辑所以@Jim U和@ user3419297张贴的代码工作得很好! GroggyOtter的代码在运行时会出错。 Forivin的代码似乎以另一种方式工作(如下所述)。 非常感谢你们所有人!
EDIT 2更加容易代码
MButton::
MouseGetPos, xpos, ypos
Sleep, 50
Click
Loop
{
Sleep 50
Send, {\ down}
Sleep 50
Send, {\ up}
If GetKeyState("MButton", "P") AND (A_TimeSinceThisHotkey > 300) ; When the MButton is pressed and after 300ms have elapsed(to prevent it from stopping direcly after triggering it.
Break
}
Click %xpos%, %ypos%, 0
Return
太感谢你了,它的工作原理! –