执行脚本B时,AHK禁用脚本A.

时间:2015-12-05 17:59:09

标签: autohotkey

嗨,我的脚本几乎完成,但执行热键时出现问题

问题:当我点击Alt + Space时,它与Space冲突..它们相互重叠或执行两个热键,这使得自定义修饰键不稳定或无法正常工作

这是代码:

127.0.0.1    dummy-host2.example.com 

如果 alt + space keycombo被按下,我想添加一条规则此热键不起作用

意思是我想在脚本B执行时禁用脚本A

脚本A ::

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

脚本B ::

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

提前谢谢

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

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中自定义我的旋转和平移导航