2

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?

4

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>

  • 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. – Lri Dec 31 '12 at 9:54

You must log in to answer this question.

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