【问题标题】:How to make a key toggle itself down and up with AutoHotKey如何使用 AutoHotKey 使键自行上下切换
【发布时间】:2015-03-16 17:17:55
【问题描述】:

我的热键的目标是使选项卡类似于大写锁定,因为它会切换键是否被按住,除了切换 shift 我需要它来切换自身。当我试图找到问题的根源时,当我将热键替换为 tab 以外的东西时,它起作用了。

这是我目前所拥有的

n = 1
~$*Tab::
{
    if n = 1
    {
        n = 0
        Send {Tab down}
    } else {
        n = 1
        Send {Tab up}
    }
}

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    让您的代码仅在按键释放时触发和切换:

    $Tab Up::
    if (toggle:=!toggle) {
        Send, {Tab Down}
    } else {
        Send, {Tab Up}
    }
    Return
    

    在此处查看 UP 关键字:http://ahkscript.org/docs/Hotkeys.htm#Symbols

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-13
      • 1970-01-01
      • 2019-06-06
      • 2014-08-14
      • 2021-08-05
      • 2014-04-09
      相关资源
      最近更新 更多