Autohotkey 自动热键哑语法问题(同一脚本中的两个函数)
下面我有两个函数。他们自己工作,但我不能让他们在同一个脚本工作。底部的那个不行。有人能帮我修一下吗。例如,下面的“升档和升档”或“升档和升档”将不起作用。我不确定我做错了什么Autohotkey 自动热键哑语法问题(同一脚本中的两个函数),autohotkey,Autohotkey,下面我有两个函数。他们自己工作,但我不能让他们在同一个脚本工作。底部的那个不行。有人能帮我修一下吗。例如,下面的“升档和升档”或“升档和升档”将不起作用。我不确定我做错了什么 endKeys := "{BS}{Enter}{Insert}{Home}{Pgup}{PdDwn}End}{Delete}" . "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}" . "{LShift}{RShift}{Tab}{Esc}{C
endKeys := "{BS}{Enter}{Insert}{Home}{Pgup}{PdDwn}End}{Delete}"
. "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}"
. "{LShift}{RShift}{Tab}{Esc}{CAPSLOCK}{Ctrl}{PrintScreen}{NumLock}"
. "{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}"
. "{Numpad7}{Numpad8}{Numpad9}{NumpadDel}{Up}{Down}{Left}{Right}"
. "{LAlt}{RAlt}{.}{,}{/}"
~Alt Up::
Input, key, V L1 t0.5 E, % endKeys
If (Errorlevel ~= "Alt") {
Double_ALT := true
Sleep 2000
Double_ALT := false
}
return
; Press a key within two seconds after double tapping the Alt key, to activate an action:
#If (Double_ALT)
a:: MsgBox, Test
b:: MsgBox, Test
c:: MsgBox, Test
d::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
Double_ALT :=false
return
s:: MsgBox, Test
f:: MsgBox, Test
return
LShift & RShift::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
return
RShift & LShift::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
return
endKeys:=“{BS}{Enter}{Insert}{Home}{Pgup}{PdDwn}End}{Delete}”
. “{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}”
. “{LShift}{RShift}{Tab}{Esc}{CAPSLOCK}{Ctrl}{PrintScreen}{NumLock}”
. “{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}”
. “{Numpad7}{Numpad8}{Numpad9}{NumpadDel}{Up}{Down}{Left}{Right}”
. “{LAlt}{RAlt}{.}{,}{/}”
~Alt Up::
输入,键,V L1 t0.5 E,%endKeys
If(Errorlevel~=“Alt”){
Double_ALT:=真
睡眠2000
Double_ALT:=false
}
返回
; 双击Alt键后两秒钟内按一个键,激活一个操作:
#如果(双重替换)
a::MsgBox,测试
b::MsgBox,测试
c::MsgBox,测试
d::
FormatTime,CurrentDateTime,MM/dd/yy-hh:mmtt
SendInput%CurrentDateTime%
Double_ALT:=false
返回
s::MsgBox,测试
f::MsgBox,测试
; 谢谢你。这就解决了问题。还有一个问题。升档和升档似乎有一个小错误。有时,我认为当你第三次快速按下一个移位键时,它会以某种方式将移位注册为按住状态,直到你多次按下其中一个移位键以释放它。当它处于该状态时,您用鼠标选择的任何内容都会高亮显示。这不是最优雅的方法吗?或者你看到了是什么导致了它和修复方法吗?
endKeys := "{BS}{Enter}{Insert}{Home}{Pgup}{PdDwn}End}{Delete}"
. "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}"
. "{LShift}{RShift}{Tab}{Esc}{CAPSLOCK}{Ctrl}{PrintScreen}{NumLock}"
. "{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}{Numpad0}"
. "{Numpad7}{Numpad8}{Numpad9}{NumpadDel}{Up}{Down}{Left}{Right}"
. "{LAlt}{RAlt}{.}{,}{/}"
~Alt Up::
Input, key, V L1 t0.5 E, % endKeys
If (Errorlevel ~= "Alt") {
Double_ALT := true
Sleep 2000
Double_ALT := false
}
return
; Press a key within two seconds after double tapping the Alt key, to activate an action:
#If (Double_ALT)
a:: MsgBox, Test
b:: MsgBox, Test
c:: MsgBox, Test
d::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
Double_ALT :=false
return
s:: MsgBox, Test
f:: MsgBox, Test
; return <-- likely your problem.
; #IF <-- Use this if you don't want your hotkeys below effected by the IF Directive
LShift & RShift::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
return
RShift & LShift::
FormatTime, CurrentDateTime,,MM/dd/yy - hh:mmtt
SendInput %CurrentDateTime%
return