Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have enabled altgr-intl keyboard layout. How can I remap such that Windows key acts as AltGr instead of right Alt key.

KDE 4.3.2

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You could use xmodmapto do this.

At a terminal, try entering:

xmodmap -e "keysym Super_L = Alt_R"

This command says: "When I press the key on the left (SuperL in this case), make it do what the key on the right does (AltR)." For that to work I'm assuming that the Windows key has the keysym Super_L; however it may not on your computer.

To find out the exact keysyms on your system, run xev from a terminal, and then press your Windows key and your Alt Gr key.

You should see part of the output along the lines of:

KeyRelease event, serial 33, synthetic NO, window 0x2800001,
    root 0x6a, subw 0x0, time 24394571, (-167,-89), root:(384,232),
    state 0x48, keycode 115 (keysym 0xffea, Alt_R), same_screen YES,
    XKeysymToKeycode returns keycode: 113
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

The part with keysym in brackets is what you're after. This tells you what keysyms to use in the xmodmap command.

Once you have determined the xmodmap command you want to use, you might like to put it in your .bashrc file so that it is executed automatically every time you log in to KDE.

share|improve this answer
    
Hi, thank you for the detailed answer. :-) I was able to remap the left Windows key. However, I had to use xev and the hexadecimal codes there. Thanks for the pointer. How can I remove the AltGr functionality from the right Alt key? –  Alan Haggai Alavi Dec 7 '09 at 1:48
1  
If depends what you want the Alt Gr key to do. I guess you want it to do the same as a normal Alt key? If so, use xmodmap -e "keysym Alt_R = Alt_L" (or whatever the equivalent keysyms are on your machine.) If you want to remove functionality from Alt Gr altogether, you can use xmodmap -e "keysym Alt_R = ". Note that you can use keycode as opposed to keysym (keycode information is also available in xev) -- you may need it if your keysyms get screwed up. –  ngm Dec 7 '09 at 11:17
add comment

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.