Adapting the keyboard layout for German

Hi,

I have a newly installed Librem 15v4. I like to change the keyboard mappings from English to German in PureOS but I can’t figure out how to adapt the key mapping to replace the “missing” “|” “Pipe” key. Am I missing something?

Any help is really appreciated. :slight_smile:

Which physical keyboard layout do you own?
US-ANSI?

Yes, I guess so. It’s the keyboard shown in this picture:

So I think in your case it is helpful to give you some overview about different keyboard layouts.
Please find a comprehensive comparison here.

My assumtion in your case: You are trying to type on a US ANSI keyboard as if it were a German one (DE ISO). Example: You would like to press “y” resulting in “z” as output.

Of course, this works. BUT as you can find in the link above: US ANSI keyboard has one physical key less than DE ISO. The key for “<, >, |” writes 3 different characters. “<” and “>” can be found elsewhere when having changed. But “|” needs to be typed with “Alt Gr” pressed (on DE ISO) and is therefore not assigned when switching to German input on US ANSI keyboard.

You can still use “Alt + 124” to type “pipe”. Wow that rhymes. :wink:
Or another combination that works on Linux distros like PureOS (Debian).

Thanks for your answer and your explanations. I am aware that the US-ANSI layout has this one key missing. I changed the system keyboard setting to DE ISO, thinking that the “Pipe” would just be attached to a new key combo because of the change. At some point I realized it wasn’t, so I tried to to define a key combination with Gnome Tweaks, but that doesn’t work. Same result for “key-mapper” which I found on github.

I also tried to define a key combo with xkb, but I couldn’t figure out how to intercept the correct keycodes and where to set them for Wayland.

2 Likes

It is not a solution to your original problem, but if your need for the german layout is covered with the german-typical latin extensions (äöüß) plus €-symbol, you might try to set your xkb layout to de(us), which adds the extensions to the corresponding basic letters on a basic us layout via AltGr-composition. In the basic layout however the compositing for the accents like á à is not available.

1 Like

Thanks for this suggestion. I changed indeed the keyboard layout to an us based variant as temporary solution.

So for “ä” I would have to type AltGr + [ or so and for Ä I press AltGr + Shift + [ ?

And is the right Alt key automatically AltGr? I consider buying a L14. I like English layouts but those characters you mentioned are missing and frequent in German.

I found a solution by myself. After some digging in stackexchange posts and the comparison of different layout files in /usr/share/X11/xkb/ I adapted the file /usr/share/X11/xkb/symbols/de in the following way:

default
xkb_symbols "basic" {

include "latin(type4)"

name[Group1]="German";

//Anpassung
key.type[Group1] = "EIGHT_LEVEL";
//Anpassung Ende

key <AE02>	{ [         2,   quotedbl,  twosuperior,    oneeighth ]	};

...

    key <BKSL>	{ [numbersign, apostrophe, rightsinglequotemark,   dead_breve ]	};
//Anpassung
key <AB01>	{ [         y,          Y,       guillemotright,    U203A, less 	] };
key <AB02>	{ [         x,          X,        guillemotleft,    U2039, greater 	] };
key <AB03> 	{ [         c,          C,         cent,    copyright,  bar ]	};
//Anpassung Ende
key <AB04>	{ [         v,          V,   doublelowquotemark, singlelowquotemark ]	};

...

   include "level3(ralt_switch)"
//Anpassung
include "level5(rctrl_switch)"
//Anpassung Ende
};

The result is as desired: By pressing RCTRL+z I get a “<”, with the x key a “>” and with RCTRL and c I get my beloved “|” :wink:

No, on this layout you get “ä” by pressing “AltGr + a”, “Ö” by pressing “AltGr + Shift + O”, “ß” by pressing “AltGr + s” etc.
I am not yet using PureOS, but I am looking forward to buy a L14, I am not sure if you can choose this layout in this distribution.

In my opinion, since the US layout is most often a fallback layout when other configurations don’t work out, the advantage of having a modified US layout is that you automatically have all non-alphanumeric characters ready for typing and are also used to the layout. The thing I miss most from this layout compared to standard German layout are the ` and ’ compositions on vowels, but when I need them I am now used to switching to a secondary layout. Another plus is that the German in many cases has unpractical key combinations for special characters, and this can be avoided on the modified US layout.

2 Likes

There is another possibility I found out about just recently: the EURkey layout (Wikipedia). This adds to a standard US layout a broad set of letters used in several European languages. I am still looking if I can get used to it.

1 Like

Please share your experience.

When I look at the L14 keyboard it seems only to have alt keys but not AltGr. Is that a problem?

I actually have no L14 in my hands, so I can’t test it.

In any case, the xkb keymap for EURkey on my installation identifies the AltGr key as “ralt”, (right Alt?), as do other keymaps; I think the visible label/imprint on the upside of the key does not stop the system from identifying this particular button as the Alt-modifier-key on the right side of the keyboard, and that you can consider the behavior of your right Alt-key as the same of an AltGr-key.

Please confirm or refute this.