2015-12-05 45 views
-1

喜再次我的劇本已接近完成,但有問題的執行熱鍵AHK禁用腳本A時,腳本B執行

問題:當我按下Alt +空格它與空間衝突..他們overlaping對方或執行兩個熱鍵,這使得自定義組合鍵不穩定或無法正常運轉的intented

這裏是代碼:

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 +空格鍵 keycombo按住該熱鍵將無法工作

意思是我想禁用腳本A如果腳本B執行

腳本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 

預先感謝您

+2

1)儘量'sendplay ''而不是'發送'2)嘗試爲鍵標籤加上前綴:'$ space ::'和'$!space ::'3)試試這兩種方法 – wOxxOm

+0

謝謝你的回覆,但我真的不知道sendplay和keylabels .. im在自動熱鍵中仍然是新的 –

+0

目前您使用'send',我建議使用'sendplay'並在鍵標籤前添加'$',像我一樣hown。你也可以閱讀官方的[教程](https://autohotkey.com/docs/Tutorial.htm)。 – wOxxOm

回答

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 
+0

謝謝你是類似的格式代碼,有人給了我AHK論壇的答案 –

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的