Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)
mod3
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

1 Answer 1

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

 
discard

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.