如何在autohotkey中打破keywait

时间:2017-12-28 17:14:43

标签: autohotkey

在这里,我想按住Shift键,然后单击q和鼠标左键。然后单击鼠标左键后我想释放Shift键。每当我点击鼠标右键时,我也想释放Shift键。 代码在这里,但不起作用: -

q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return

1 个答案:

答案 0 :(得分:0)

如果Shift键为Down,则q ::不起作用,则需要使用+ q ::

对于Rbutton ::如果Shift键关闭然后Rbutton ::不起作用,则需要使用+ Rbutton ::

[+ = Shift]

试试这段代码:

; [+ = Shift] [! = Alt] [^ = Ctrl] [# = Win]
#SingleInstance Force

q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return

+q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        +RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return