Uncap - Map Caps Lock to Escape on Windows, Linux, and macOS
github.com
github.com
Output:
...............................................................
...............................................................
.................. @@@@@@@ ......... @@@@@@@ ..................
............... @@@@ @@@@ ... @@@@ @@@@ ...............
............. @@@ @@@ @@@ @@@ .............
............ @@@ @ @@@ ............
............ @@@ Cutie Pai, @@@ ............
............ @@@ @@@ ............
............. @@@ I love you! @@@ .............
............... @@@@ @@@@ ...............
.................. @@@@ -- Susam @@@@ ..................
..................... @@@@ @@@@ .....................
........................ @@@@ @@@@ ........................
........................... @@@ @@@ ...........................
.............................. @ ..............................
...............................................................
...............................................................On Windows, I think most people who would want to remap these keys are already using AutoHotKey to set up custom global hotkeys or do other tweaks.
The entire AHK script is a 2 liner that you can put into an existing script, such as:
CapsLock::Esc
Esc::CapsLock
Only including that here because the OP's alternative AHK example in the readme remaps CapsLock to Escape, but it doesn't include remapping Esc to CapsLock (both are necessary to swap the keys).His current example would leave your Esc key unchanged, meaning you would have 2 escape keys and 0 CapsLock keys.
Is there a way with AHK to map CapsLock tapped by itself to Esc and held with other keys as Ctrl?
But Google came up with this: https://autohotkey.com/board/topic/104173-capslock-to-contro...
The last reply's code sample looks like it would do what you want in a non-buggy way. If not, there were about 20 other Google results for combo mapping CapsLock to CTRL and / or Escape depending on how it was pressed.
* Start app 'System Preferences'
* Pick 'Keyboard'
* Click button 'Modifier Keys...'
* Per keyboard you can now configure what the caps lock key does. One of the options is 'escape'. Which is what it should be :)
The other operating systems just are described how you can do the change without the tool, see https://github.com/susam/uncap#mac-system-preferences
Also, a more interesting question would be how to map caps lock to ctrl (or something else) on hold, and esc on tap, across platforms.
`$ setxkbmap -option caps:escape` is exactly what I use. Very helpful of the author of the tool to include simpler/alternatives to the tool. Kudos!
Turns out you can enable caps2esc, which is mentioned in the blog post, on NixOS with a single line:
services.interception-tools.enable = true;Definitely agree. I'm a big fan of that behavior. It would be nice to have a single project that supports it cross-platform. At the moment, I'm doing:
On linux, https://github.com/alols/xcape .
On OSX, https://github.com/tekezo/Karabiner-Elements after some setup.
Not sure about windows. Maybe there's some AHK script out there for it?
I'd thoroughly recommend a HHKB to any programmer.
Nothing is as comfortable for me and I’ve tried a few, so remapping caps is still useful to me.
Been using them with Linux for about 5 years with no issues at all, yet to have one fail, the one I use at work the letters all wore off and I eventually wore through the faux leather padding surface but it's a nice high density foam so it's not breaking up.
I've taken them apart a few times down to boards out and keycaps off to clean them with no issues.
For a properly ergonomic keyboard at that price they are damn hard to beat so much so I have a spare new in box and am thinking of buying another just in case.
As a hopefully interesting comparison, for me the right choice is a logical layout that is decoupled from the physical layout. And a Russian physical layout keyboard from Apple. And an US software layout.
(I'm Icelandic and don't speak or write Russian. Not yet at least.)
The Russian keyboard has all the programming symbols in the right places, a two-story enter key, and has the key between left-shift and Z. And gorgeous Cyrillic symbols on each key, in addition to the English-layout keys. Then my fingers sit on something beautiful that they know.
Russian layout: https://store.storeimages.cdn-apple.com/4982/as-images.apple...
US layout: https://store.storeimages.cdn-apple.com/4982/as-images.apple...
And I love the crisp action that Apple's keyboards have today. – I appreciate that some don't like the feel. That's why we need a rainbow of variety!
Then I remap things in software. I personally remap Caps Lock to Ctrl and keep Esc where it is.
It is not very Russian though. We call it European on your first pic. And Russian ~= Asian, as shown here http://xahlee.info/kbd/russian_keyboard_layout.html
Last decade layouts shuffled here heavily, probably due to supplier chain ignorance, and also laptop-like keyboard vendors, who put keys randomly to save space. It is a headache to find a good keyboard with the layout you used to.
- English (International) layout: https://store.storeimages.cdn-apple.com/4668/as-images.apple...
- English (US) layout: https://store.storeimages.cdn-apple.com/4668/as-images.apple...
- Russian layout: https://store.storeimages.cdn-apple.com/4982/as-images.apple...
For Windows/Linux, an easily available European keyboard with the double-height enter, extra key next to Z, and most of the "programming" keys in the same place as the American layout is the British/Irish layout.
(The main difference is " and @ are swapped. Shift-3 becomes £, but that pushes # to the extra, unshifted key, which is a plus. I have never used ¬.)
on Mac I use Karabiner Elements to rebind it to escape (though you can also use System Preferences).
On Windows -which I try to avoid- I use a registry edit to disable caps lock which one can find via a search engine (do verify the contents). This has the advantage that you can still bind it e.g. in games (such as for push-to-talk).
For those who search a AutoHotKey (AHK) alternative on Linux, consider AutoKey [1] which has Python scripting support.
If you’re interested in some of the differences, start in `:help ins-special-keys`.
This seems like the wrong approach to remap keys on Windows. This tool is using a keyboard hook, so it needs to run always for the remapping to work.
Windows already has a way of remapping keys through the registry that will persist over reboots, without re-running the tool. There are many GUI tools for modifying the key-mapping in registry, I use SharpKeys (https://archive.codeplex.com/?p=sharpkeys)
It also has built-in key remapping so you don’t need to mess with anything on the OS level.
Let’s you remap anything with a nice GUI editor to boot.
My non-official download here: https://stuff.kjonigsen.net/remapkey.exe
As for random EXEs on the Internet, you’ll have to trust me or find alternate sources.
It’s a good tool. Does one thing and does it well.
This allows me to type special characters in an intuitive way, such as producing © with compose o c, or π with compose p i, along with definable custom shortcuts.
Is this for MacBook Pro models with a Touch Bar, or is it something else altogether? In the former case, a better title would be "Map Escape to Caps Lock".
I edit my sources and remote configs exclusively in vim-likes since ~2004 (full time sw dev) and never experienced such issues. From my experience, typing or clicking speed requirement rarely exceeds that of thinking on your program. I hit esc often, but not too often, and it is not too far.
I’m not against caps->esc mapping in general, but for me this would have little to no value plus non-standard layout, which is minus, since I’m not office-only guy.
What is a function in your programs deserve such a prominent position??
In my case as an emacs user bloq mayus, get's remaped to CTRL.
Vin users need ESC.
Put your hands on the keyboard home row (where they belong).
Try to reach esc without taking them out of there. Hurts, don't it?
Now try reaching caps lock. Much better, right?
That's why.
Caps lock is useless. Esc is extremely useful (for vi users). So we get rid of caps lock and put something more useful there.