AHK 在执行脚本 B 时禁用脚本 A

AHK Disable Script A when Script B is Executed

你好,我的脚本快完成了,但是执行热键时出现问题

问题:当我按下 Alt + Space 时它与 Space 冲突 .. 它们相互重叠或同时执行两个热键,这使得自定义修改键不稳定或无法按预期工作

代码如下:

space::
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
return

!space::
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
return


#if, GetKeyState("MButton")
    Lbutton::
    RButton::
    return
#if

我想添加一条规则,如果 alt + space 组合键被按住,这个热键将不起作用

意味着我想在执行脚本 B 时禁用脚本 A

脚本 A ::

space::
    send {shift down}{MButton down}
    KeyWait, space
    send {shift up}{Mbutton up}
    return

脚本 B ::

  !space::
    send {Mbutton down}
    KeyWait, space
    keywait, alt
    send {Mbutton Up}
    return

提前致谢

space:: 部分包裹在 #If, !GetKeyState("Alt")

!space::
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
return


#if, !GetKeyState("Alt")

space::
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
return

#if, GetKeyState("MButton")
    Lbutton::
    RButton::
    return
#if
space::
Hotkey_Alt_Space = 0    ; disabled
send {shift down}{MButton down}
KeyWait, space
send {shift up}{Mbutton up}
Hotkey_Alt_Space = 1
return

!space::
If (Hotkey_Alt_Space != 0)  ; enabled
{
send {Mbutton down}
KeyWait, space
keywait, alt
send {Mbutton Up}
}
return

我在 AHK 论坛上得到了某人的帮助谢谢你花时间解决问题我可以在 sketchup 上自定义我的旋转和平移导航