Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just started out using tmux, so I figured I would set my Caps lock key equal to the Ctrl key.

Though sometimes I do need the Caps lock key. I don't care if it requires playing with the Terminal or system files, I'm not afraid of that. However it would be nice if I could just run Terminal commands so that I can put it in a script. Also, if possible, it would be nice if it doesn't require extra software, although if it's necessary then there's no problem.

How can I make it so that it's normally a Ctrl key, but if I press it for say 5 seconds it triggers a normal Caps lock. I was wondering, how can I do this?

share|improve this question
up vote 3 down vote accepted

Using KeyRemap4MacBook, you could add this to private.xml:

<autogen>--HoldingKeyToKey-- KeyCode::CONTROL_L, KeyCode::CONTROL_L, KeyCode::VK_NONE, KeyCode::CAPSLOCK, Option::NOREPEAT</autogen>

The threshold for holding a key is 0.2 s by default, but it can be changed in the second tab.

This would change fn+caps lock (control) to caps lock:

<autogen>--KeyToKey-- KeyCode::CONTROL_L, ModifierFlag::FN, KeyCode::CAPSLOCK</autogen>

share|improve this answer
That would work. However this old Mac keyboard doesn't have an fn key (it's kind of old). How could I change that to option+capslock? – greduan Dec 30 '12 at 14:58
Also, I suppose this requires KR3MB? Yes? If so, is there a way not to use KR4MB? – greduan Dec 30 '12 at 15:06
Just change ModifierFlag::FN to ModifierFlag::OPTION. I don't know any other way to do it. – user495470 Dec 31 '12 at 9:54
I see, thank you! That works out. – greduan Dec 31 '12 at 13:58

Your Answer


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.