0
1
If possible I would like something similar to this: https://apple.stackexchange.com/a/4815/31313
Basically a simple script that detects when I'm in tmux
, if I am change the CAPS lock key to be a CTRL key, else revert it.
However it is also important for me to use the CAPS lock key from time to time, in those occasions I would like to keep it pressed for 5 seconds, then it triggers a normal CAPS lock.
Would this be easy to do? Possible to do? I would prefer if I don't use any kind of extra software so that I can just put this in a script.
Extra info:
I would want to achieve this in a Mac Mini with OSX Snow Leopard, if possible also with Mountain Lion.
So, I would add
<only>TERMINAL</only>
after the autogen statement? Or inside it? Would this also work if iTerm is used instead of the Terminal app? Thanks for the tip, although I don't have an fn key with this keyboard (it's a couple of generations of iMac back), you think that would work if I did <kbd>Option+Shift+Caps lock</kbd> instead? – greduan – 2013-01-07T03:21:12.617Before or after it. But
<only>TERMINAL</only>
is just Terminal.app, and there's no constant for iTerm. For option and shift, changeModifierFlag::FN
toVK_OPTION | VK_SHIFT
. – Lri – 2013-01-07T03:29:48.817OK, so I use
<autogen>--HoldingKeyToKey-- KeyCode::CONTROL_L, KeyCode::CONTROL_L, KeyCode::VK_NONE, KeyCode::CAPSLOCK, Option::NOREPEAT</autogen><only>TERMINAL</only>
if I want the functionality I requested in the post, after changing the holding key threshold. And I would<autogen>--KeyToKey-- KeyCode::CONTROL_L, VK_OPTION | VK_SHIFT, KeyCode::CAPSLOCK</autogen><only>TERMINAL</only>
if I want to remap caps lock to CTRL and press <kbd>Option+Shift+Caps lock</kbd> to switch caps lock. Right? – greduan – 2013-01-07T03:35:37.790If you wanted caps lock to function as caps lock outside Terminal, you'd need to use PCKeyboardHack to change caps lock to something like F19 and then remap F19.
– Lri – 2013-01-07T03:48:40.403Ah I see, thanks! Although this does solve it, it doesn't do it with a script so I won't accept it, but it's definitely a workaround. Thanks for looking into this. :) – greduan – 2013-01-07T03:51:02.623