Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 3 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

Surely, you can achieve this by editing the xkb rules set but it might be more convenient to use xmodmap.

You can use xev to lookup the keycode of your AltGr key. On my system it also has the name ISO_Level3_Shift which is already used for the modifier mod5 (use xmodmap to see the modifier maps). Removing it from mod5 and adding it to the control modifier makes the AltGr key work like the Ctrl: xmodmap -e "remove mod5 = ISO_Level3_Shift"; xmodmap -e "c add control = ISO_Level3_Shift".

share|improve this answer
    
Thanks for your help. However the reason I asked for setxkbmap is because some xmodmap entries on my /.xsesssionrc seem to be ignored at system startup, and they don't take effect. How can I edit the xkb rules to achieve the same effect? Thanks again. –  mt22 Feb 25 '12 at 9:00
    
Anyway thanks antje-m. I'm going to +1 your answer when I'll get 15+ rep! –  mt22 Feb 26 '12 at 18:08
    
Thank you. You mentioned that some xmodmap in .xsessionrc get ignored. Have you considered that your desktop environment might set some keyboard options that override yours? I know you didn't ask, but the thought just crossed my mind. –  antje-m Feb 29 '12 at 2:18

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.