13v4 German keyboard: keys missing: |, @, etc. 'AltGr' not working in general

Here’s what worked for me:

  • copy /usr/lib/udev/hwdb.d/60-keyboard.hwdb to /etc/udev/hwdb.d:
    sudo cp /usr/lib/udev/hwdb.d/60-keyboard.hwdb /etc/udev/hwdb.d/
  • edit the new file, e.g.:
    sudo vi /etc/udev/hwdb.d/60-keyboard.hwdb
  • find the section labeled # Purism by typing /Purism (slash and then the word Purism) and hitting enter
  • delete the whole section or comment the section out - now vi gets interesting if you do not already know it. Simplest thing to delete those lines by maneuvering the cursor in the first line to be deleted and then pressing d twice to delete one row. Repeat until done.
  • save the edited file by hitting :wq followed by enter.

You can use your favorite text editor in place of vi. You also can comment the section out and make it look like the file on my Librem13v4:

###########################################################
# Purism
###########################################################

# # Purism Librem 13 V2
# evdev:atkbd:dmi:bvn*:bvr*:bd*:svnPurism*:pn*Librem13v2*:pvr*
#  KEYBOARD_KEY_56=backslash
# 
# # Purism Librem 13 V3
# evdev:atkbd:dmi:bvn*:bvr*:bd*:svnPurism*:pn*Librem13v3*:pvr*
#  KEYBOARD_KEY_56=backslash

# Purism Librem 13 V4
# evdev:atkbd:dmi:bvn*:bvr*:bd*:svnPurism*:pn*Librem13v4*:pvr*
# KEYBOARD_KEY_56=backslash

Either way after reboot your keys should work (if I didn’t forget anything else I had to do on my very painful and disappointing way to a working keyboard.

A short explanation (to be corrected by people who do know and/or remember better than me): The english keyboard does have a firmware error and needs those lines to fully work. Unfortunately this workaround breaks the german keyboard which does not have this firmware error.

The file you copied and edited overrules the original file in /usr/lib/udev/hwdb.d. Any update to that original file will not activate for you if you choose this solution (and I do not see a good reason why this should be a problem).

From my point of view it is extremely disappointing that this issue has not already been fixed for customers who order their Librem with a german keyboard. I would go as far as saying that it is disrespectful to send a system to customers known not to work.

1 Like

Hi ChriChri,
thank you so much for your help. I really appreciate that. But it did not work.

The angle brackets work now - as with another trial of a solution before. But it seems that my major problem is not the key next to the Y but the not working AltGr key.

And thanks for the hints with vi. It feels like some decades ago, but I wrote my whole master thesis with vi :wink:

Manuel, thank your very much for ypur help

did you do a restart after setting that parameter or at least restarted the udev subsystem

both

I’d be really interested in the content of your /etc/dev/keyboard

I did what ChriChri recommended

maybe some of the info from the Debian Keyboard wiki might help out.

Maybe that is what I have to do next. But that is not what I had in mind to have to do when I bought a brand new notebook with a hardwarespecific OS

since that “@” Key problem has never happened before

It looks like that the problem is the non working AltGr key, affecting all the other problems: |, {}, []@ etc.

Hm, I can’t remember having done anything for that key to work (but hey, that doesn’t mean anything :wink: ).

Could you have a look at the output of xev? It is contained in the package x11-utils that you might have to install.

Uhm, don’t know if this works in wayland (the default display server in PureOS). A quick search reveals that for wayland you’d use wev.

If you call x- or wev from a terminal (e.g. Tilux) you’ll get information about key-presses and mouse movement (inside the little test window) printed out to the terminal.

For xev it looks like this:

someuser@somehost:~$ xev
Outer window is 0x4200001, inner window is 0x4200002

Followed by a lot of stuff that is not interesting for your case.

If you press your key at the end of all that output, you’ll get some more output: one block for pressing the key down, one block for letting the key return back to its upper position. In my terminal this looks like this:

KeyPress event, serial 37, synthetic NO, window 0x4200001,
    root 0x1b3, subw 0x0, time 266837517, (1584,638), root:(1634,1085),
    state 0x10, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4200001,
    root 0x1b3, subw 0x0, time 266837677, (1584,638), root:(1634,1085),
    state 0x90, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

You can see that a KeyPress and a KeyRelease event had been registered.

Within the output you can find keycode 108 (keysym 0xfe03, ISO_Level3_Shift) which describes that the keycode send by my AltGr key is 108 and it is translated to ISO_Level3_Shift which is the function you’d expect to write symbols like @ and € on a german keyboard.

Thanks again.
if I do that, key 108 translates to

keysym 0xff20, Multi_key

and at my out put the line
XKeysymToKeycode:
is missing completely

Should I then add
KEYBOARD_KEY_108=92
to my
/etc/udev/hwdb.d/60-keyboard.hwdb

I’d suggest that you first look at your configuration like @Manuel suggested:

someuser@somehost:~$ cat /etc/default/keyboard 
XKBLAYOUT="de"
BACKSPACE="guess"
XKBVARIANT="qwerty"
XKBMODEL="pc105"
XKBOPTIONS="compose:caps"

What does your file contain?

If you do not have the configuration right (for whatever reason) there is no sense in starting to modify single keys of a possibly wrong layout.

It is

XKBMODEL=“pc105”
XKBLAYOUT=“de”
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE=“guess”

…does not do any difference

Another difference ist that in your case both events - hit and release - produce
XFilterEvent returns: False
in my case hitting the key produces XFilterEvent returns: True and the release XFilterEvent returns: False
But I do not know what that means.

You need to get your keyboard configuration right. Try:

sudo dpkg-reconfigure keyboard-configuration

Choose PC genèric de 105 tecles (intl.) and then Duits - Alemany (QWERTY) - don’t ask me, why it is in Dutch in my case. Then you can choose how your AltGr should work. I chose Der Standard für die Tastenbelegung and set your preference for the compose key (the key you need to generate utf-8 characters composed from two keypress like ø generated by pressing <compose> '/' 'o'. Choose whether you want to be able to restart your xserver by the proposed key combination and your done.

Check your /etc/default/keyboard again, reboot and try.

Hi ChriChri,
thanks again. I did all that already - and did it again after your post - and also tried different setting. No difference. The AltGr key is still not working :rage:

Did it change your /etc/default/keyboard? What option did you choose for AltGr in the configuration menu of sudo dpkg-reconfigure keyboard-configuration?

If this were true, wouldn’t that mean every time someone scrubs PureOS and puts something else on there (Ubuntu, for example) this fix from Purism wouldn’t be present? Does this sit in coreboot or Seabios? I wouldn’t think so.

Yes it did, so the tools seem to work. It looks now like:

‘XKBMODEL=“pc105"’
‘XKBLAYOUT=“de”’
‘XKBVARIANT=“qwerty”’
‘XKBOPTIONS=“l3v:ralt_switch”’

‘BACKSPACE=“guess”’

And I tried almost any reasonable setting for the AltGr key. The reconfiguration tool works obviously und changes the values accordingly. But the key still does not work

Yes, as far as I understood. You’d need to add the fix that is already present in PureOS.

I have never had any keyboard related problems. The | keys works without issue. So I’m not sure that the fix is necessary under other distros.

Maybe this could be a solution for @erichq: Install another distro and see if the keyboard behaves properly.

Although from reading your thread, it seems like your AltGr key is not functioning properly.

I wonder… if you switch your keyboard layout to english, does the key still not respond?

Did you setup your keyboard in Gnome? Which one did you choose? My setup looks like this:

Never tried other distributions on my Librem. The fix is as I remember only needed for an “English (US)” keyboard.

Furthermore: the fix seems to be upstream in the debian buster package also. If you’d install Debian Buster, you’d have the 60-keyboard.hwdb containing the Purism-keyboard-fix also. Maybe it is in Ubuntu and other distributions also.

But as I said - never had a US(English) keyboard Librem nor tried another distribution on my Librem. If you’re interested in the backgrounds you’ll have to look into it yourself (and hopefully let us know what you’d find :slight_smile: ).

I checked all settings - no success.

Now I wanted to try another linux, bit the system does not even boot from the Ubuntu DVD:
‘graphic initialization failed…’

…what shall I say…

What version of Ubuntu are you using? I’ve installed Ubuntu on my Librem numerous times. You shouldn’t have any problems. 18.04 and 19.10 have been without issue.

Elementary OS (Hera 5.1) has also worked flawlessly.

Tried Pop OS once as well.

Of course it sounds like you are using Pureboot unlike me with Seabios and coreboot.