It appears that the keyboard Layout Options that allow things such as "Swap the Escape key and Caps Lock" have disappeared from the keyboard settings in 14.04 Is there another GUI where they can be set? Or is it back to dotfiles?
-
Yeah, they removed most of that in 14.04. If you want it back, report a bug. – Braiam Apr 08 '14 at 00:58
-
It indeed works, except for VirtualBox, where it does not and one is forced to resort to Xmodmap. – Adriano Mitre Jul 22 '14 at 01:47
-
same but not 14.04 specific: http://askubuntu.com/questions/363346/how-to-permanently-switch-caps-lock-and-esc – Ciro Santilli OurBigBook.com Sep 25 '14 at 09:15
4 Answers
Install the GNOME Tweak Tool (gnome-tweak-tool), under the Typing tab there is an option to swap Esc with Caps Lock. This worked for me in Ubuntu 14.04.

- 114,770

- 434
- 5
- 2
-
1
-
It's in "Typing" -> "Caps Key Behavior". Very similar to previous menus. Thank you user268068! https://dl.dropboxusercontent.com/u/17011409/gnometweaktool.png – wujj123456 Apr 20 '14 at 08:15
-
1this doesn't work very well (Unity ignores this setting for me). – if __name__ is None Nov 22 '14 at 20:04
-
This tool is not default tool in Ubuntu installation so better way exists. – Léo Léopold Hertz 준영 Dec 31 '15 at 20:34
-
2I do not recommend this tool because it is unstable. This answer should not be accepted one. – Léo Léopold Hertz 준영 Dec 31 '15 at 20:41
I struggled with this a bit during my last OS setup, and found a solution. On this setup I had to trudge through the Internet again to find. Let me leave it here for future reference.
I am using Ubuntu 14.04 LTS (working with 16.04 too), and this is how I remapped my caps lock to escape:
- Open terminal
- Open the
/etc/default/keyboard
file with sudo (egsudo nano /etc/default/keyboard
) add
caps:swapescape
to theXKBOPTIONS
. After modification the line should like the followingXKBOPTIONS="caps:swapescape"
Note that I did not try this with the caps:swapescape
setting. I used the caps:escape
setting; i.e. my modification just remaps caps lock to escape but does not map my escape to caps lock.

- 55
As I mention in another similar question, the usual way to swap Esc and Ctrl is with the following lines in the ~/.Xmodmap
file:
clear Lock
keysym Caps_Lock = Escape
keysym Escape = Caps_Lock
add Lock = Caps_Lock
This should work with all desktop environments (KDE, Gnome) on most common distros (Ubuntu and Debian family, Fedora and RH family).

- 2,815
-
2Thanks so much for this. This is a nice change for using Vim. I am in Xubuntu. Adding this config file is much better than installing a whole new program just for one setting as suggested in the accepted answer. – jbrock Aug 14 '16 at 17:38
-
Another solution is the one mentioned in this post how to permanently switch caps lock and esc that uses dpkg-reconfigure
with a few extra steps but setting "caps:swapescape"
in xkb-options