虽然我自己是不用这个的,不过好像在一些新手人群中,有需求啊。看着有的写几百行也是累,所以这里提供有个思路。
故意留下单键连点的开关没有写,前面的内容已经为这个功能的实现铺好路了,很容易看出来。算是个想学ahk的新手留个作业啦
#singleinstance force
switchs := {all:0}
loop, 26
{
key := chr(a_index + 96)
hotkey, % "~" . key , shoot, on
switchs[key] := 1
}
switchs["all"] := 1
return
^s::
if(switchs["all"] = 1)
switchs["all"] := 0
else
switchs["all"] := 1
return
shoot:
key := substr(a_thishotkey, 2, 1)
loop
if(getkeystate(key, "p") & switchs["all"]=1 & switchs[key])
send, % key
return
;TODO:: 单键开关,代码中故意多出来的部分已经给出了提示


,连发是可以, 不过有BUG, 就是如果我按了W那么Q连发就没用了,,,
理论上不存在这个问题,我测试也不存在这个问题。。。。