After watching some videos about tmux and vim collaboration I wanna remap Caps Lock on my ubuntu.

Remapping Caps Lock to Esc is easy I used gnome-tweak-tool, but now I wanna change Caps Lock behavior to work as Esc and Ctrl in some situations.

When I use only Caps Lock it works like Esc. When I use Caps Lock with some other key it works like Ctrl +something. How do I do that?

  • I really doubt that it can be done without rewriting the X keyboard interface. I personally have remapped Caps to Esc, and Esc to Ctrl. Sep 19 '15 at 16:07

You can achive that using xmodmap. Please find the documentation here or ArchWiki https://wiki.archlinux.org/index.php/Xmodmap

Be careful though, sometimes a few portion is only Arch related.

Alternatively you can use two different shortcuts CAPS+ and CTRL+ to execute same commands in Menu > Keyboard > Shortcuts


Gnome Tweak Tools Update In the new Gnome Tweak Tools, there is an option to swap the Esc key and the Caps lock key. It's located under the Keyboard and Mouse tab, and the Additional Layouts Button. This is on Ubuntu 18.04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.