Gnome: Map AltGr key to Alt

For those UK users still pulling their hairs out, this worked for me:

xmodmap -e "clear mod5"
xmodmap -e "keycode 108 = Alt_L"

Explanation: The first line removes the current behaviour of your AltGr (which is assigned to the mod5 modifier). The second takes the AltGr key (which on my keyboard produces a keycode of 108), and maps that to whatever keycode your Alt_L key is mapped to.

If you have no idea what is going on with keycodes and keysyms, I found this xmodmap introduction very useful.


gnome-tweak-tool lets you do this with a GUI:

Typing -> Key to choose 3rd level -> Right Alt key never chooses 3rd level