7 ms·
Uncap - Map Caps Lock to Escape on Windows, Linux, and macOS
- petepete 7y agoI solved this problem many years ago by switching to a keyboard with a better layout. I'd thoroughly recommend a HHKB to any programmer.
- sparso 7y agoHappy Hacking Keyboard - https://www.hhkeyboard.com/ https://www.hhkeyboard.com/
- schemathings 7y agoWhy does it have 2 USB ports?
- noir_lord 7y agoNever switching back to something that isn’t Ergo 4000 or Ergo 4000 shaped if they ever stop making them. Nothing is as comfortable for me and I’ve tried a few, so remapping caps is still useful to me.
- makapuf 7y agoNice, how is linus support (regarding extra scrollwheel, buttons..)
- noir_lord 7y agoWorks fine, media keys all work out the box fedora/cinnamon and you can remap the extra keys however you want, I have the star mapped to Trello and 1 through 5 mapped to particular Trello boards etc. 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.
- AnthonBerg 7y agoI fully respect your choice :) 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.com/is/MRMH2RS?wid=1144&hei=1144&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1520717644293 https://store.storeimages.cdn-apple.com/4982/as-images.apple... US layout: https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MRMH2?wid=1144&hei=1144&fmt=jpeg&qlt=95&op_usm=0.5%2C0.5&.v=1520629359080 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.
- wruza 7y ago>two-story enter, key between lshift/z 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 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.
- tauchunfall 7y agoThat's interesting. When you order from the Apple website from German region, you can choose e.g. English (US) and English (International). But US region does not allow to choose English (International). - English (International) layout: https://store.storeimages.cdn-apple.com/4668/as-images.apple.com/is/MLA22Z?wid=1144&hei=1144&fmt=jpeg&qlt=80&op_usm=0.5,0.5&.v=1498602296120 https://store.storeimages.cdn-apple.com/4668/as-images.apple... - English (US) layout: https://store.storeimages.cdn-apple.com/4668/as-images.apple.com/is/MLA22LL?wid=1144&hei=1144&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1496944005839 https://store.storeimages.cdn-apple.com/4668/as-images.apple... - Russian layout: https://store.storeimages.cdn-apple.com/4982/as-images.apple.com/is/MLA22RS?wid=1144&hei=1144&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1496943898748 https://store.storeimages.cdn-apple.com/4982/as-images.apple...
- fenesiistvan 7y agoIt would be nice to find a store where you can actually try the keyboards before to buy. I am using a Microsoft keyboard since 10 years and unable to accomodate with anything else, already wasted money for around 10 more keyboards with no luck. They are good as gift only, but everybody is bored already on my keyboard gift surprises :)
- petepete 7y agoIf you can't find a shop maybe try a local Mechanical Keyboards meetup. They happen all over (more than 400k members now) and you'd get excellent advice and the opportunity to test lots of models. https://www.reddit.com/r/MechanicalKeyboards/ https://www.reddit.com/r/MechanicalKeyboards/
- goerz 7y agoThe tool itself is actually Windows-only, it seems. 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.
- rgoulter 7y agoDitto return key: return on tap, ctrl on hold.
- diggan 7y agoIndeed, the tool itself is windows but repository contains a list of alternatives: https://github.com/susam/uncap#alternatives https://github.com/susam/uncap#alternatives `$ 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!
- dguo 7y agoAfter doing this (ctrl on hold and escape on tap) on every system I use, I wrote a blog post with instructions: https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-control/ https://www.dannyguo.com/blog/remap-caps-lock-to-escape-and-...
- danieldk 7y agoOh, that's nice! I had capslock mapped to control, but I wanted to have escape on tap as well. But I never bothered to figure it out on Wayland. Turns out you can enable caps2esc, which is mentioned in the blog post, on NixOS with a single line: services.interception-tools.enable = true;
- jrib 7y ago> a more interesting question would be how to map caps lock to ctrl (or something else) on hold, and esc on tap, across platforms. 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 https://github.com/alols/xcape . On OSX, https://github.com/tekezo/Karabiner-Elements https://github.com/tekezo/Karabiner-Elements after some setup. Not sure about windows. Maybe there's some AHK script out there for it?
- timidiceball 7y agoWhy does one need this on macOS (which has had a dedicated toggle for this in System Preferences for a few versions now)?
- rzwitserloot 7y agoFor the casual reader who does not know: * 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 :)
- diggan 7y agoYou don't, because this doesn't run on macOS, it only runs on Windows. 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 https://github.com/susam/uncap#mac-system-preferences
- EdSchouten 7y agoEaster egg in the source code: https://github.com/susam/uncap/blob/78f52d7b2e03fc51885c8072d53ff5d41fbe3ffc/uncap.c#L469-L506 https://github.com/susam/uncap/blob/78f52d7b2e03fc51885c8072... Output: ............................................................... ............................................................... .................. @@@@@@@ ......... @@@@@@@ .................. ............... @@@@ @@@@ ... @@@@ @@@@ ............... ............. @@@ @@@ @@@ @@@ ............. ............ @@@ @ @@@ ............ ............ @@@ Cutie Pai, @@@ ............ ............ @@@ @@@ ............ ............. @@@ I love you! @@@ ............. ............... @@@@ @@@@ ............... .................. @@@@ -- Susam @@@@ .................. ..................... @@@@ @@@@ ..................... ........................ @@@@ @@@@ ........................ ........................... @@@ @@@ ........................... .............................. @ .............................. ............................................................... ...............................................................
- Fnoord 7y agoOn Linux I use GNOME Tweaks to rebind it to escape (though you can also use xmodmap directly). It doesn't work on console, and I don't think it works in Wayland either (!!). 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. [1] https://github.com/autokey/autokey/ https://github.com/autokey/autokey/
- nickjj 7y agoI just use AutoHotKey because I'm already using AHK for so many things. 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.
- karmakaze 7y agoI suspect it was intentional as I too would want 0 keys mapped to CapsLock. Is there a way with AHK to map CapsLock tapped by itself to Esc and held with other keys as Ctrl?
- nickjj 7y agoI've never tried that behavior and I'm also not an AHK wizard (I use it for a few global hotkeys, remapping escape and some small tweaks). But Google came up with this: https://autohotkey.com/board/topic/104173-capslock-to-control-and-escape/ 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.
- zaat 7y agoOn Linux you can either set it in gnome or, if you are using a wm, just run setxkmbap -option caps:escape.
- m000 7y agoCan someone explain what's the purpose of this remapping? 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".
- rodorgas 7y agoI use vim, so esc is one of the most important keys. But I use esc in most apps very frequently. I don’t use Caps Lock at all.
- _rrnv 7y agoI still don't get it. We have a keyboard with an Esc key and a Caps Lock key. Why would I remove Caps Lock and use it as another Esc key?
- paulhilbert 7y agoTry pressing esc every few seconds for 8-12hrs a day like a vim developer does and you'll know.
- wruza 7y ago(Single datapoint ahead.) 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.
- elviejo79 7y agoInverse: question you have a big key, in the home row. That is a very valuable keyboard position. 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.
- Tharkun 7y agoI only use keyboards with QMK firmware these days. It's much easier to flash a new layout to my keyboard than it is to keep messing around with OS settings for keyboards.
- yannikyeo 7y ago+1. I too use a custom keyboard with QMK firmware. In addition to mapping Caps Lock to Esc, I also map holding down of Caps Lock to Ctrl.
- maxerickson 7y agoAlso see https://docs.microsoft.com/en-us/sysinternals/downloads/ctrl2cap https://docs.microsoft.com/en-us/sysinternals/downloads/ctrl...
- Hendrikto 7y agoI bind it to Scroll Lock, which I absolutely never use. That way I have a conveniently reachable key to use for whatever I need atm.
- oneplane 7y agoIs this just for VIM users or is there another reason why someone would want to specifically remap the Escape key and ditch the Caps Lock?
- josteink 7y agoOn Windows I just use remapkey.exe. Let’s you remap anything with a nice GUI editor to boot. My non-official download here: https://stuff.kjonigsen.net/remapkey.exe 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.
- domenukk 7y agoPSA: In VIM ctrl-c does the same as ESC. No need to remap of you relearn.
- chrismorgan 7y agoThis is not entirely true, and the differences between them sometimes matter. If you want an equivalent, go for CTRL-[, which is actually equivalent. If you’re interested in some of the differences, start in `:help ins-special-keys`.
- bollockitis 7y agoSee also: SharpKeys (https://github.com/randyrants/sharpkeys https://github.com/randyrants/sharpkeys)
- jesperhh 7y agoEDIT: This is actually already mentioned in the README 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 https://archive.codeplex.com/?p=sharpkeys)
- envoked 7y agoFor anyone looking for a new keyboard with custom key maps, I’d really recommend the Kinesis advantage. I switched to it 8 years ago to fend off carpal tunnel after my old keyboard was bothering my wrists. It was easy to get used to and now whenever I’m on my Macbook’s keyboard, it feels archaic. It’s strange that by default (probably a relic from typewriters) we use our most important digits solely for bashing on the space bar. It also has built-in key remapping so you don’t need to mess with anything on the OS level.
- MiddleEndian 7y agoI use win compose on Windows and whatever built in tools on KDE in Linux to treat caps lock as the compose key. 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.