【问题标题】:Special mode with ALT, like with capslock带有 ALT 的特殊模式,例如使用 capslock
【发布时间】:2014-09-22 10:36:40
【问题描述】:

我想在点击 alt 后打开“箭头模式”(就像我在点击大写锁定后打开大写字母模式一样)。

我想按一次 alt,然后一直使用字母作为箭头(就像按住 alt 一样),然后再次按 alt 退出“箭头模式”并使用普通字母。 我希望我能够按下 alt+D (同时)而不是箭头,而是程序快捷方式。

现在我使用左字母作为箭头:

; Arrows on s,d,f,e
!e::SendInput,{UP}
!s::SendInput,{LEFT}
!f::SendInput,{RIGHT}
!d::SendInput,{DOWN} 

但我无法使用 alt+d(这是我的程序快捷方式)

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    这是一个更清洁的解决方案。 (请务必使用 AHK_L)

    LAlt::(ArrowMode:=!ArrowMode)
    
    #If ArrowMode
        e::Up
        s::Left
        d::Down
        f::Right
    #If
    

    【讨论】:

      【解决方案2】:

      你已经覆盖了 alt-d 所做的事情,所以它不会再做任何其他事情了。 但是您编写的代码并没有按照您描述的那样做。 我认为你需要的是一个切换:

      e::SendInput,{UP}
      s::SendInput,{LEFT}
      f::SendInput,{RIGHT}
      d::SendInput,{DOWN}
      Alt::
      Hotkey, e, Toggle
      Hotkey, s, Toggle
      Hotkey, f, Toggle
      Hotkey, d, Toggle
      Return
      

      http://ahkscript.org/docs/commands/Hotkey.htm

      【讨论】:

      • @Forivin 为什么不呢?使用 Alt 作为热键可能会有问题。无论如何,我不建议这样做。使用不同的热键肯定会起作用。
      • 如果你尝试过它并且它对 nvm 有效,但是 afaik 你不能使用热键命令切换 ::-hotkeys。
      • 是的,您还可以使用热键命令切换 ::-hotkeys。我已经用了很多年了。 ahkscript.org/docs/commands/Hotkey.htm 热键命令不是问题,使用Alt作为热键可能会。
      【解决方案3】:
      ;define our hotkeys:
      Hotkey, e, Up
      Hotkey, s, Left
      Hotkey, d, Down
      Hotkey, f, Right
      ;set the hotkey labels:
      Up:
        SendInput, {Up}
      Return
      Left:
        SendInput, {Left}
      Return
      Down:
        SendInput, {Down}
      Return
      Right:
        SendInput, {Right}
      Return
      ;set the toggle key for these hotkeys:
      LAlt::
          Hotkey, e, Toggle
          Hotkey, s, Toggle
          Hotkey, d, Toggle
          Hotkey, f, Toggle
      Return
      

      【讨论】:

        猜你喜欢
        • 2016-01-29
        • 2020-01-23
        • 1970-01-01
        • 1970-01-01
        • 2018-07-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-02-06
        相关资源
        最近更新 更多