Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

Is there a way to remap the AltGr key to Ctrl with setxkbmap?

I've already checked the option section in "/usr/share/X11/xkb/rules/base.lst" but I didn't find an entry for AltGr...

I also tried xmodmap, however some xmodmap entries on my ~/.xsesssionrc seem to be ignored at system startup, and they don't take effect. Therefore I decided to achieve that through setxkbmap or xkb...

My keyboard layout is set to gb (on an italian keyboard).

This is what xmodmap prints:

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

And this is what xev prints when I press AltGr:

state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92

Thanks for help.

share|improve this question
up vote 1 down vote accepted

Thanks to the suggestions of the Xorg community I found out the correct setxkbmap command:

setxkbmap -option ctrl:ralt_rctrl
share|improve this answer

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.