使用 AutoHotKey (AHK) 创建类似 Vim 的功能 [英] Creating Vim like functionality with AutoHotKey (AHK)
本文介绍了使用 AutoHotKey (AHK) 创建类似 Vim 的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我最近一直在 Windows 8 机器上使用 autoHotKey 并且喜欢它.但我希望能够按下大写锁定并将键盘变成类似 vim 的命令模式,以便在任何程序中轻松移动光标、插入和删除.
I've been using autoHotKeyrecently on a windows 8 machine and loving it. But I want to be able to press caps lock and turn the keyboard into a vim like command mode for moving the cursor, inserting and deleting easily in any program.
更新(感谢@MCL 到目前为止的帮助)
UPDATE (Thanks to @MCL for the help so far)
我正在尝试使用以下脚本,但它不会根据状态改变行为
Im trying to use the following script but it wont change the behaviour based on the state
state := GetKeyState("Capslock", "T")
if state
j::Send,{Left}
l::Send,{Right}
i::Send,{Up}
k::Send,{Down}
return
推荐答案
使用 #If:
#If GetKeyState("CapsLock", "T")=1
; The following hotkeys will only be effective if GetKeyState("CapsLock", "T")=1
j::Send,{Left}
l::Send,{Right}
i::Send,{Up}
k::Send,{Down}
#If ; end of #If
这篇关于使用 AutoHotKey (AHK) 创建类似 Vim 的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文