Show HN: Uncap: Map Caps Lock to Escape on Windows, Linux and Mac
github.com
github.com
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.
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.
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.)
In fact I swap my Alt and Control keys, and don't use AltGr for its original intent at all, because using AltGr+7/8/9/0 on the German keyboard to type {[]} is horrible. I use an english layout (which I modified with my AltGr+j/k/l/i thing and a bunch of other tweaks) instead.
But, neat to see how it's done!
It has the spacebar split with an enter key in the middle.
This program should be pretty useful to avoid having to fuck around with the registry (on windows) or xinput (on linux)
Or within emacs?