Tip for vi users on Mac: get Karabiner-Elements and use the “complex modifier” that makes the Caps Lock key into ESC when you just press it, but Control when you use it with another key.
I didn't like that option, because I found I tend to hold Ctrl to do some action (maybe copy text from some panel), and if I change my mind and release it, the ESC might close the window I'm looking at.
It's happened more than once with Chrome's Inspector or in the shell. It would be even worse with Emacs in terminal mode, where ESC is a prefix key.
If it could be OK for you other than that, there is usually a timeout setting that can be applied before it is recognised as a press.
For example, any press under 200ms is ESC, anything over will register as Ctrl. The timeout can be adjusted to work and not capture that time that you press it but then decide you don't want it.
You can limit the remapping to certain applications, in my case Emacs, IntelliJ, and VS Code. Doesn't help if you want to run the editor in a terminal, though.
I use Emacs with vim bindings. I also have a Moonlander and I absolutely love it. I've got my QMK set up so that the key just below my left thumb (I press space with my right hand, so left is best for this—you might switch it depending on how you hit the space bar) is ESC on tap and Control on hold. This is the single-biggest improvement to ergonomics from a software side. Spend the time to figure out how to get this done, and then get used to it. Your hands will thank you until you breath your last breath.
Indeed. And you can do the same thing with AutoHotKey on Windows and xcape or interception-tools on linux. Interception-tools has the big advantage that it doesn't just work under X (but also the console and wayland).
I use input-mapper on Linux to achieve the same. It’s truly a game changer. Converting 1 useless but highly accessible key into 2 useful ones is fantastic.
I don't know how people put escape there. For me it's a common key to accidentally press. I don't want to accidentally be pressing escape and closing out of dialogs and whatnot. On my desktop keyboard I've actually mapped the caps lock key to F13, which I only ever use for activating push-to-talk since it's easy enough to reach and an accidental tap doesn't really matter since it would only transmit for a fraction of a second.
Well, I take it you are not a vim user? :) There is no other reason to put Escape there. If I didn't use vim, I'd use the CapsLock key just for Control and not also for Escape.
i did this on the software side for the longest time, before I DIY'd a keyboard and got this feature hardware-side using q/tmk: https://qmk.fm/. Some prebuilt keyboards also support QMK, like the DROP CTRL.
I also use dvorak, and the keyboard setup every time i used different keyboard was getting a bit annoying.