3

I am using AutoHotkey to rebind Ctrl to Capslock like this:

Capslock::Ctrl

I have also bound my home keys for movement while Capslock is held:

^h::Send {LEFT}
^j::Send {DOWN}
^k::Send {UP}
^l::Send {RIGHT}

Trouble is, I can hold Capslock and issue one movement combo, but subsequent taps of h,j,k or l while still holding Capslock results in one of those letters appearing in my editor. In other words, it's as if Capslock is being released, even though I am still holding it down. If I hold the actual Ctrl key and use the movement bindings, it works fine. Anyone know how to rectify this?

3 Answers 3

3

The solution was kindly posted on the AutoHotKey forum by "VxE":

Capslock::
   Gui, 93:+Owner ; prevent display of taskbar button
   Gui, 93:Show, y-99999 NA, Enable nav-hotkeys: hjkl
   Send {LCtrl Down}
   KeyWait, Capslock ; wait until the Capslock button is released
   Gui, 93:Cancel
   Send, {LCtrl Up}
Return

#IfWinExist, Enable nav-hotkeys: hjkl

   *h::Send {Blind}{LCtrl Up}{Left}{LCtrl Down}
   *j::Send {Blind}{LCtrl Up}{Down}{LCtrl Down}
   *k::Send {Blind}{LCtrl Up}{Up}{LCtrl Down}
   *l::Send {Blind}{LCtrl Up}{Right}{LCtrl Down}

#IfWinExist, ; end context-sensitive block
0

I think it's because the PC reads capslock as a TOGGLE key. Caps is pressed and it alters a state, then it's pressed again and the state goes back. The other non-lock keys keep sending their signal as long as and each time they are pressed.

2
  • Thanks for the explanation, but do you know how I solve the problem? Aug 1, 2010 at 19:01
  • Probably to use a different key besides a LOCK key.
    – JNK
    Aug 1, 2010 at 21:35
0

Maybe you can try scancode mapping method like this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .