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.

1 Answer 1


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

setxkbmap -option ctrl:ralt_rctrl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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