Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

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
share|improve this answer
add comment

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.

share|improve this answer
    
Thanks for the explanation, but do you know how I solve the problem? –  Charles Roper Aug 1 '10 at 19:01
    
Probably to use a different key besides a LOCK key. –  JNK Aug 1 '10 at 21:35
add comment

Maybe you can try scancode mapping method like this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.