Aug/1012
German Umlauts on US Keyboard in X (Ubuntu 10.04)
The US keyboard layout is better for programmers since many of the needed special chars like brackets, semicolons and so on are easier to type than, for example, with the German keyboard layout which I used so far. Since I am programming a lot on my notebook I decided to buy a new keyboard with the US layout to make it easier to learn using the US layout.
Besides programming I often write German documentations, mails and other kinds of texts. When writing things in German the umlaut chars like ä, ö and so on are important. So I would miss these chars a lot when using the US keyboard layout. In fact there are some key combinations in linux and/or X11 to type those chars but they way too complicated to be used while writing a longer text.
After some research I found a solution by using the user specific Xmodmap file. See how I modified that configuration file to fit my needs…
xmodmap is used to the keyboard modifier map and keymap table in X11 to convert event keycodes into keysyms. The file ~/.Xmodmap is the xmodmap configuration file for defining user specific key mappings. So this is the best place for me to define the mappings of the umlaut keys.
With the configuration snippet below I tell xmodmap several things:
- Add the
Mode_switchto my right ALT key. - Add the euro-sign (€) to third level of the E-Key
- Add the cent-sign (¢) to third level of the C-Key
- Add the lower and upper a-umlaut (ä) to third level of the A-Key
- Add the lower and upper o (ö) to third level of the O-Key
- Add the lower and upper u (ü) to third level of the U-Key
- Add the sharp s (ß) to third level of the S-Key
! Map umlauts to RIGHT ALT + <key> keycode 108 = Mode_switch keysym e = e E EuroSign keysym c = c C cent keysym a = a A adiaeresis Adiaeresis keysym o = o O odiaeresis Odiaeresis keysym u = u U udiaeresis Udiaeresis keysym s = s S ssharp
After appending the code above to the ~/.Xmodmap file I executed the following command as user to test my new personal xmodmap:
lm@Klappspaten:~ > xmodmap ~/.Xmodmap
With this configuration loaded I can hit the right ALT key plus the mapped key to type one of the umlaut chars. So easy…
Btw. I use the following to disable the most useless key I can expect: capslock
! disable capslock
remove Lock = Caps_Lock



























23:51 on September 2nd, 2010
thanks for that! In addition I used boths ALT (hopefully, that does not conflict):
keycode 108 = Mode_switch keycode 64 = Mode_switch
Where can I find a correct table with the keycodes? The tables I found do not fit to that 108=R-ALT.
12:39 on September 3rd, 2010
You can run the command ‘xev’ and then hit the key you want to know the keycode for. Then xev outputs the keycode and other information on the terminal.
19:25 on September 3rd, 2010
For the right ALT, it shows: KeyPress event, serial 33, synthetic NO, window 0×3600001, root 0x12f, subw 0×0, time 950008315, (746,-327), root:(750,502), state 0×10, keycode 134 (keysym 0xffec, Super_R), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False
but that doesnt give me the needed 108.
The left-ALT I used, was not a good idea, it stops to make ALT-TAB working. I Wonder which code is the Menu key.
20:20 on October 17th, 2010
Thanks a lot for this!
19:28 on December 22nd, 2010
thanks for that! In addition I used boths ALT (hopefully, that does not conflict): keycode 108 = Mode_switch keycode 64 = Mode_switch Where can I find a correct table with the keycodes? The tables I found do not fit to that 108=R-ALT.
22:09 on December 23rd, 2010
For the right ALT, it shows: KeyPress event, serial 33, synthetic NO, window 0×3600001, root 0x12f, subw 0×0, time 950008315, (746,-327), root:(750,502), state 0×10, keycode 134 (keysym 0xffec, Super_R), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False but that doesnt give me the needed 108. The left-ALT I used, was not a good idea, it stops to make ALT-TAB working. I Wonder which code is the Menu key.
02:57 on December 24th, 2010
thanks for that! In addition I used boths ALT (hopefully, that does not conflict): keycode 108 = Mode_switch keycode 64 = Mode_switch Where can I find a correct table with the keycodes? The tables I found do not fit to that 108=R-ALT.
16:31 on July 31st, 2011
Assign a key to compose international characters by hitting the off button on the right upper corner choose Sytem Settings choose keyboard choose layouts choose options choose under Compose key position for instance Right Alt close close close control center you have to type very fast (you will need some practice) with one hand: hold down right-alt hold down o with the other hand: hit shift ” result –> ö the same for : right-alt u shift ” result –> ü
right-alt i shift ” result –> ï right-alt o shift / result –> ø
right-alt ss result –> ß right-alt e ‘ result –> é right-alt e ` result –> è
12:05 on October 19th, 2011
Thank you very much for this tips. I’ve been looking for this solution for ages! You bright my day.
22:34 on October 29th, 2011
Thanks! This was very helpful. I have a problem (Kubuntu 11.04, upgraded to Kubuntu 11.10 and problem is still there) that I cannot add new keyboard layouts. I searched and searched but couldn’t find any solution — but this is actually better!