【问题标题】:Fixing Keyboard shortcut send in Auto Hot Key修复 Autohotkey 中的键盘快捷键发送
【发布时间】:2019-08-20 02:08:16
【问题描述】:

您好,这是一个超级简单的问题,但我希望有人能帮我解决两个 AutoHotKey 问题。

我试图让 Cntrl、J 和 I 键成为发送 alt、h、v 和 f 的键盘快捷键。

到目前为止,我已经尝试了这两种输入方式

^&j&i::Send, !&h&v&f

^ji::Send, !hvf

以及发送后没有逗号的每个。

我还希望以非常小的延迟发送这些密钥,例如每个密钥之间的 5 毫秒

我正在考虑使用类似的东西

^&j&i::

{
Send, {! down}
sleep 5
Send, {h down}
sleep 5
Send, {v down}
sleep 5
Send< {f down}
}

当然,这也行不通。任何帮助表示赞赏

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    参考https://www.autohotkey.com/docs/Hotkeys.htm#combo 不支持三个或更多键的组合。考虑到这一点,我们需要在定义热键之前检查控制键的键状态。

    需要注意的其他一些事项:SendInput 是理想的发送方法,您可能希望这些键恢复到我在示例中包含的状态。

    #if GetKeyState("LControl", "P")
    {
        j & i::
        {
            SendInput {Alt down}
            sleep 5
            SendInput {h down}
            sleep 5
            SendInput {v down}
            sleep 5
            SendInput {f down}
            sleep 5
            SendInput {Alt Up}
            sleep 5
            SendInput {h Up}
            sleep 5
            SendInput {v Up}
            sleep 5
            SendInput {f Up}
            return
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-20
      • 2011-06-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多