【问题标题】:AHK - How to hold a macro while Physical Key depressedAHK - 如何在按下物理键时按住宏
【发布时间】:2016-03-07 20:28:44
【问题描述】:

我想做的是这样的:

Numpad3::
    if(not GetKeyState("Shift" , "P") and not GetKeyState("RButton" , "P"))
    {
        SendInput {Shift down}
        Sleep, 33
        Click down right
    }
Return

Numpad3 Up::
    Sleep, 100
    Click up right
    Sleep, 33
    SendInput {Shift up}
Return

但由于某种原因,当我松开按钮时它并没有取消。 :(

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    我建议使用Send {RButton Down}(或Up)发送鼠标右键,而不是Click up right

    此外,如果不是真的有必要,您也不想发送随机的Sleep,因为它会造成延迟并使脚本不优雅并且可能不可读。

    这里是发送Control 而不是RButton 的代码,但这只是为了让我可以在 Notepad++ 中对其进行测试。

    只需将Control 替换为RButton 即可:

    *NumpadPgDn::
    *Numpad3::
        Send {Shift Down}{Control Down}
    return
    
    *NumpadPgDn Up::
    *Numpad3 Up::
        Send {Shift Up}{Control Up}
    return
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-19
      • 2021-05-25
      • 2013-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多