有人可以用这个AHK脚本帮助我

时间:2016-03-26 20:25:32

标签: autohotkey

我希望这个Autohotkey脚本能够使用切换选项自动按空格键,这样我就不必一直按住空格键。切换键应该是鼠标中键。你能帮我写一下吗?因为我发现的切换部分似乎不起作用。在此先感谢CptPrice:D

Main script:
*~$Space::
Sleep 100
Loop
{
GetKeyState, SpaceState, Space, P
If SpaceState = U
break
Sleep 5
Send, {Blind}{Space}
}

Toggle-part:

#MaxThreadsPerHotkey 2   

MButton::
if (toggle := !toggle) {
    ; on
} else {
    ; off
}
return

1 个答案:

答案 0 :(得分:2)

toggle := false
return

MButton:: toggle := !toggle

#If toggle

#MaxThreadsPerHotkey 2

*~$Space::
Sleep 100
Loop 
{
Sleep 5
Send, {Blind}{Space}
    if (!toggle)        ; Press MButton to break
        break
}
return

#If