【问题标题】:how to break keywait in autohotkey如何在 autohotkey 中打破 keywait
【发布时间】:2017-12-29 21:26:56
【问题描述】:

这里我想按住 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

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    如果 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
    

    【讨论】:

      猜你喜欢
      • 2022-01-15
      • 2015-05-02
      • 2018-05-17
      • 1970-01-01
      • 1970-01-01
      • 2016-02-11
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多