0
votes

I have an autohotkeys script to map CapsLock + i j k l to be my arrow keys:

CapsLock & h::
   Send, {Left down}{Left up}
Return

CapsLock & k::
   Send, {Down down}{Down up}
Return

CapsLock & i::
   Send, {Up down}{Up up}
Return

CapsLock & l::
   Send, {Right down}{Right up}
Return

And it works some of the time. However when I use Caps + i j k l with another key like shift for highlighting, or alt + tab, it ceases to work properly.

How do I add these use cases to my script?

1

1 Answers

1
votes

Use the remapping syntax and you're all good.

CapsLock & h::Left
CapsLock & k::Down
CapsLock & i::Up
CapsLock & l::Right

There was no use to send both the down and up events anyway.
And the specific thing in the remapping syntax which makes this work, is that it uses the blind send mode. You can read up on it if you're interested, but basically it avoids releasing modifier keys which might be held down when input is to be sent.