Ubuntu – Simplest way to swap esc key with ` key

10.10keyboard-layoutxmodmap

What is the simplest way to swap the functionality of the Esc key and the ` key?
System ➜ Preferences ➜Keyboard ➜ Layouts ➜ Options let me swap my Ctrl key and Capslock key, which was good, but it doesn't seem to let me do other keys in a generalized way.

The xmodmap answer that got accepted here was useful. Now my ` key is on the physical Esc key, and vice versa. The problem is that when I Shift+Esc I still only get a ` when I'd like to get a tilde.

Best Answer

You want to follow the five-point list of instructions on the ubuntuforums by Andy Meier: http://ubuntuforums.org/showthread.php?p=10286878#post10286878

The keys you'd have to modify in your /usr/share/X11/xkb/symbols/mynewlayout would be:

key <ESC> {[ quoteleft, asciitilde ] };

key <TLDE> {[ escape ] };

You then have to register this new layout as described on the forum. Good luck.