Autohotkey AHK在执行脚本B时禁用脚本A
您好,我的脚本几乎完成了,但在执行热键时出现了问题 问题:当我点击Alt+Space时,它与空格冲突。。它们彼此重叠或同时执行两个热键,这使得自定义修改器键不稳定或无法按预期工作 代码如下:Autohotkey AHK在执行脚本B时禁用脚本A,autohotkey,Autohotkey,您好,我的脚本几乎完成了,但在执行热键时出现了问题 问题:当我点击Alt+Space时,它与空格冲突。。它们彼此重叠或同时执行两个热键,这使得自定义修改器键不稳定或无法按预期工作 代码如下: space:: send {shift down}{MButton down} KeyWait, space send {shift up}{Mbutton up} return !space:: send {Mbutton down} KeyWait, space keywait, alt send {
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
提前感谢您将
空格::
部分包装在#If!GetKeyState(“Alt”)
我在AHK论坛得到了某人的帮助谢谢你的时间问题解决了我可以在sketchup自定义旋转和平移导航1)尝试
sendplay
而不是send
2)尝试在键标签前加前缀:$space:
和$!空格::
3)尝试这两种方法谢谢你的回复,但我真的不知道sendplay和keylabels。。自动热键我还是新手当前您正在使用send
,我建议使用sendplay
,并在键标签前添加$
,正如我所示。另外,你可能想看看官方的。谢谢,这是类似的格式代码,有人给我的答案,从AHK论坛
!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