Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can one map the key combination Shift-Win to work as AltGr on Debian-based Linux distributions? XKB is very sparsely documented indeed!


share|improve this question
up vote 1 down vote accepted

The easiest way I know of is to run xev to find the keycode for your windows key (on my keyboard, it's 133, but it is likely to be different on yours), then find the keysym names for the windows key and Alt Gr (again, xev can help here, as can /usr/include/X11/keysymdef.h, which is in x11proto-core-dev on Ubuntu). To use xev, just run it from the command line, then press the key you're interested in and look at the output.

I think Alt Gr is either Alt_R or ISO_Level3_Shift (the key labelled "Alt Gr" on my keyboard is mapped to the latter, but my left "Alt" key is mapped to Alt_L).

Then you can put something like the following in your shell initialisation file, e.g. ~/.bashrc (an alternative is .xmodmaprc):

xmodmap -e 'keycode 133=Super_L ISO_Level3_Shift'

See man xmodmap for more, and these pages:

A different way to do it in Ubuntu may be via System->Preferences->Keyboard->Layouts->Options... Personally, I'm never sure what all those wordy descriptions mean ("Alt and meta are on alt keys"?).

share|improve this answer
Thanks, Croad. AltGr is in fact ISO_Level3_Shift. I'm not sure if the command actually is helping as I am having trouble with xkb right now, but either way you certainly have put me on the right track. Thanks! – dotancohen Feb 6 '12 at 18:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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