【问题标题】:Autohotkey remapping alt+j to left but alt+shift+j doesn't select left nor do alt+ctr+j move a caret , if getKeyState does not workAutohotkey 将 alt+j 重新映射到左侧,但 alt+shift+j 不选择左侧也不 alt+ctr+j 移动插入符号,如果 getKeyState 不起作用
【发布时间】:2013-06-28 13:08:45
【问题描述】:

基本上,

它的灵感来自 Vim 我想使用一个键(例如 AltF1)组合(+I J K L)来映射到箭头键

Autohotkey 中已经做了什么

Ralt & j::send{Left}
Ralt & k::send{Right}

... 现在我把 Alt+I 当作 up 等等,这对我来说很好但是当你按下时问题就来了

Ralt+Shift+j  (Suppose to select the last charater)
Ralt+Ctrl+j   (Suppose to move a caramel text)

这种组合不起作用,它只是被覆盖为基本的向左移动光标

即使我在GetKeyState 中使用 if/while 语句,它也不起作用

if GetKeyState("Shift","P")
   Ralt+j::send +{Left}
This kind of stuff didn't work

对此有什么想法吗?这将使编码非常高效,而无需移动右手。

提前致谢。

【问题讨论】:

    标签: vim keyboard-shortcuts autohotkey


    【解决方案1】:

    你缺少两件事:

    1. 在执行context sensitive hotkey 时必须使用# 符号
    2. 代码的底部使用+,而不是您之前使用的&

    看下面的修改:

    RAlt & j:: Send {Left}
    RAlt & k:: Send {Right}
    
    #If GetKeyState("Shift","P")
       RAlt & j:: Send +{Left}
       RAlt & k:: Send +{Right}
    
    ; Close with #If to remove the context or simply start another '#If GetKeystate ....'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-21
      • 2020-07-20
      • 2011-06-14
      • 2018-12-15
      • 2018-10-31
      • 1970-01-01
      相关资源
      最近更新 更多