
Show HN: Uncap: Map Caps Lock to Escape on Windows, Linux and Mac - uncap
https://github.com/susam/uncap#uncap
======
thedz
Mapping caps lock to escape is nice, but IMO the really useful move is to map
caps lock to BOTH escape and control. I use it (via Karabiner Elements on OS
X), and it's great:

Caps lock pressed AND released in isolation within 250ms is escape.

Caps lock pressed in conjunction with another key is control.

The way it seems to do it is to trigger key events on key_up rather than
key_down, meaning "escape" is triggered when you release caps lock, not when
you press it. This can feel a little strange in some edge cases, but in normal
usage, I don't notice it at all.

This has essentially saved my MacBook Pro touchbar as a dev machine, since I
absolutely loathe the touchbar escape key, but didn't want to lose caps lock
as control.

~~~
rco8786
I use this same setup and can't believe I lasted so long without it.

~~~
jorvi
Remapping right CMD to backspace is another wonderful improvement!

------
rakete
Instead of mapping to Escape (or Control) I prefer mapping Caps Lock to ISO
Level3 Shift, also known as AltGr. That way I get a whole new type of modifier
that I can use to assign custom functionality to.

For example I map AltGr+j/k/l/i to the arrow keys so that I can navigate code
without taking my fingers of the home row, regardless of the editor I am in. I
also have AltGr+h mapped to Backspace, AltGr+m is delete, AltGr+u/o are
home/end and so on and so forth. It opens up lots of possibilties.

~~~
jstanley
What keyboard do you use? There is already an AltGr key on most keyboards.

~~~
DominoTree
I haven't seen an AltGr key on a keyboard in the US in at least 15 years.

~~~
kps
At the USB HID level, AltGr is merely the right Alt key; the interpretation is
just host software.

If a keyboard physically has two keys labelled ‘Alt’ and two labelled ‘AltGr’,
then at the protocol level both ‘Alt’s are (indistinguishably) USB LeftAlt and
both ‘AltGr’s are USB RightAlt.

(Mac keyboards' ‘Option’ is the label for USB Alt and acts like Windows'
AltGr.)

------
rhencke
This is built-in to macOS - just go to Keyboard > Modifier Keys... and set
Caps Lock to Escape, or another key.

But, neat to see how it's done!

~~~
uncap
Yes, this is documented in the README: [https://github.com/susam/uncap#mac-
system-preferences](https://github.com/susam/uncap#mac-system-preferences) .

------
daenney
Considering how may key combo's require ctrl I end up remapping caps lock to
ctrl instead. And then remap the original ctrl to esc.

~~~
sixothree
Ctrl-key combinations are the ones that hurt my hands the most. I think I may
try this (again).

~~~
daenney
Same, which is why I switched. But in order to force you to do it right it
helps to rebind the original ctrl key to something else, in order to kill the
old habit. I found that after about a week or so it came pretty naturally.

~~~
sixothree
That's it. Thank you. "Container Tabs". Looks like it's not in developer yet.
Hopefully it makes it downstream eventually.

------
AdieuToLogic
As the project README "Alternatives" section[0] notes, as well as others in
this thread, remapping caps lock to alternate key codes with OS-X and
X-Windows is straightforward with tools supplied with those windowing systems.
C2[1] has a nice listing of options as well.

0 -
[https://github.com/susam/uncap#alternatives](https://github.com/susam/uncap#alternatives)

1 - [http://wiki.c2.com/?RemapCapsLock](http://wiki.c2.com/?RemapCapsLock)

------
Asooka
I use a TECK and have the right spacebar mapped to RCtrl and the LCtrl (which
is physically where you would expect Caps Lock to be on a regular kbd) and
LAlt switched. This gives me a Ctrl on a finger I don't usually use for typing
and is extremely comfortable.

~~~
securedev
Could you share a link to your TECK model? I am unable to find a TECK model
that has the spacebar split into right spacebar and left spacebar?

~~~
Asooka
There is only one model AFAIK - [https://www.trulyergonomic.com/store/truly-
ergonomic-mechani...](https://www.trulyergonomic.com/store/truly-ergonomic-
mechanical-ergonomic-keyboard)

It has the spacebar split with an enter key in the middle.

------
klondike_
The first thing I always do when I install a new OS is remap caps lock to the
Windows key, because my IBM Model M was made before the Windows key was a
thing.

This program should be pretty useful to avoid having to fuck around with the
registry (on windows) or xinput (on linux)

------
bitL
Any way to remap whole ESC-F1-F10 on touchbar macbooks to some existing keys?
BTW, is there any "glue-in" keystrip I can put over touchbar to have real keys
there?

~~~
sixothree
AutoHotKey might prove to be really useful here. Speaking of CapsLock I once
found a script that made the CapsLock also work for the number keys as well.
That was a fun one.

------
brad0
If you're looking for something more customisable you can use abseil and
Karabiner which allow full remapping of all keys on macOS.

~~~
securedev
Did you mean Seil? I can't find any app named Abseil for macOS.

------
knyt
Does anyone know how to map caps lock (or any other key [combination]) to a
key _sequence_ under Linux/Xorg?

Or within emacs?

