Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Vim like functionality with AutoHotKey (AHK)

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.

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
like image 682
Damo Avatar asked Jan 18 '26 14:01

Damo


1 Answers

Create context-sensitive hotkeys with #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
like image 174
fxam Avatar answered Jan 20 '26 02:01

fxam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!