caps2esc

caps2esc is a plugin for the interception-tools. It enables a user to capture key presses at a very low level in Linux, and change them to something else. As the name suggests, caps2esc is used to switch the capslock key with the esc key.

The escape key is extremely important in the vim/Emacs workflow. The user needs it to switch out of modes like insert.

I came upon it after wanting to change my EDITOR to helix. I remembered the Comment arrêter de se servir de vim comme un goret - Nuit de l'Info 2018.

I followed this page from the Archlinux wiki after installing intercept-tools and intercept-caps2esc.

→ From the page:

Create the following udevmon job configuration file:

/etc/interception/udevmon.d/caps2esc.yml

- JOB: intercept -g $DEVNODE | caps2esc | uinput -d $DEVNODE
  DEVICE:
    EVENTS:
      EV_KEY: [KEY_CAPSLOCK, KEY_ESC]

By default, this remaps the following:

  • Escape as Caps Lock.
  • Caps Lock as Escape when pressed alone and as Ctrl when pressed together with another key.

Next, start/enable udevmon.service.


There are many more configuration options, that can be found in the Archlinux Intercept Tools and the Gitlab page (second link from the top).

↑ Back to the top