Autohotkey将alt + j重新映射到左边但是alt + shift + j没有选择left也没有alt + ctr + j移动插入符号,如果getKeyState不起作用

时间:2013-07-01 12:01:27

标签: vim keyboard-shortcuts autohotkey

基本上,

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

Autohotkey已经完成了什么

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

... 现在我把 Alt + I 作为等等,这对我来说非常好但是当你按

时会出现问题
Ralt+Shift+j  (Suppose to select the last charater)
Ralt+Ctrl+j   (Suppose to move a caramel text)

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

即使我将if / while语句与GetKeyState一起使用,也无法正常工作

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

有关于此的任何想法吗?它可以使编码非常有效而无需移动右手。

提前致谢。

1 个答案:

答案 0 :(得分:3)

你遗漏了两件事:

  1. 执行context sensitive hotkey
  2. 时必须使用#符号
  3. 代码的底部使用+代替您之前使用的&
  4. 见以下修改:

    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 ....'
    
相关问题