AutoHotKey 哑语法问题(同一脚本中的两个函数)

AutoHotKey dumb syntax issue (Two functions in the same script)

我有以下两个功能。他们自己工作,但我无法让他们在同一个脚本中工作。最下面那个不行有人可以帮我修一下吗。例如,低于 "LShift & RShift" 或 "RShift & LShift" 将不起作用。我不确定我做错了什么。

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::
    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