
Why would you want to transform your Caps Lock
into another key, such as your Esc
or Ctrl
/ Cmd
key? To transform your most useless key into your most useful one, that’s why! Caps Lock
a terrible default option, and only continues to exist in keyboards because people are used to the layout.
When is the last time you’ve needed to use your Caps Lock
key? Let’s be honest, the Caps Lock
is really only useful if you’re an internet grandpa who likes to yell at kids to keep off Twitch! The fact that the Caps Lock
key is not only one of of the biggest on the keyboard, but also resides in a prime location on the home row makes enabling this little hack a no-brainer for huge productivity gains (not to mention the reduction in typing-releated strains/injuries).
While there are plenty of options that you can remap Caps Lock
to, this article is specificially about converting your Caps Lock
→ Escape
(when pressed alone), or Ctrl
(when pressed with another key). This allows you to use the same key to solve the most common (and un-ergonomic) problems — both the Esc
and Ctrl
key are very hard to reach with the pinky finger - and it makes working with software like VIM so much better!
ℹ️ Bonus feature:
Caps2Esc
also remaps theEsc
key to act as theCaps Lock
, helpful for those few times when I could actually use the Caps functionality (you know, for those young whippersnappers on my Twitch)
This productivity tweak can be easily set up on Windows_,_ Mac_, or_ Linux
- Linux: I highly suggest using
Caps2Esc
(which the install guide below is focused on)- This tool is much better for remapping
Caps Lock
than alternatives such asXmodmap
andxcape
, because it is built upon theinterception
library. This means that it handles the key mappings at a much lower level, and is available on the bare terminal (Ctrl+Alt+F2
) instead of depending on theX
server like other solutions. This meansCaps2Esc
works in both Wayland and X with zero reconfiguration.
- This tool is much better for remapping
- Mac OS: has multiple solutions, including the popular Karabiner-Elements tool
- Remapping the
Caps Lock
is even more important on all of the new Macbooks (2016+) with the Touch Bar. Using this solution now you can actually have anEsc
key that works!!!
- Remapping the
- Windows: has the awesome open source
dual-key-remap
tool- Like
Caps2Esc
this tool also works at a low level, and based on personal experience is a much better solution for remappingCaps Lock
→Ctrl/Esc
than AutoHotkey.
- Like
Getting up and running in Arch/Manjaro is as easy as 1-2-3!
-
Install using AUR tool of choice (using
yay
in this example):yay -S interception-caps2esc
-
Paste the contents of the below script into your terminal to configure the
Caps2Esc
service:#!/bin/bash # Post install config solution found at: https://askubuntu.com/questions/979359/how-do-i-install-caps2esc echo "Make sure you run this script as root!" # Configure udevmon.yaml echo "- JOB: \"intercept -g \$DEVNODE | caps2esc | uinput -d \$DEVNODE\" DEVICE: EVENTS: EV_KEY: [KEY_CAPSLOCK, KEY_ESC] " >> /etc/udevmon.yaml # Configure udevmon.service echo "[Unit] Description=udevmon Wants=systemd-udev-settle.service After=systemd-udev-settle.service [Service] ExecStart=/usr/bin/nice -n -20 /usr/bin/udevmon -c /etc/udevmon.yaml [Install] WantedBy=multi-user.target " >> /etc/systemd/system/udevmon.service
^ This script appends to the end of your
udevmon.yaml
andudevmon.service
files if they already exist. If you would like to play it safe, make a backup of these files first.Also, make sure to run the script as
root
! -
Start
udevmon
to start running theCaps2Esc
service# Enable udevmon systemctl enable --now udevmon
And that’s it! If everything went as it should, your Caps Lock
key should now act as the Esc
key when pressed on it’s own, and Ctrl
when pressed in combination with another key (i.e. Caps Lock
+ C
should copy highlighted text to the clipboard, Caps Lock
+ V
will paste the contents, etc).
Enjoy the power of your new magic key…your pinky finger will thank you!