]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hwdb: add XKB_FIXED_MODEL to the keyboard hwdb
authorSebastian Wick <sebastian@sebastianwick.net>
Thu, 31 Oct 2019 13:27:24 +0000 (14:27 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Nov 2019 09:08:26 +0000 (10:08 +0100)
Chromebook keyboards have a top row which generates f1-f10 key codes but
the keys have media symbols printed on them. A simple scan code to key
code mapping to the correct media keys makes the f1-f10 inaccessible. To
properly use the keyboard a custom key code to symbol mapping in xbk is
required (a variant of the chromebook xkb model is already upstream).
Other devices have similar problems.
This commit makes it possible to specify which xkb model should be used
for a specific device by setting XKB_FIXED_MODEL.

hwdb.d/60-keyboard.hwdb
hwdb.d/parse_hwdb.py

index 15f0a970b6c751ab6abfa946f08594e72cca4cf1..9227bee7ff55ae0c1b360ffd7183a249b63da3fb 100644 (file)
 #   XKB_FIXED_VARIANT=""
 # Examples of such devices: the Yubikey or other key-code generating
 # devices.
-#
+
+# A device where the scan code to key code mapping is insufficient and
+# requires a special key code to symbol configuration may specify that with:
+#   XKB_FIXED_MODEL="xkbmodel"
+# Examples of such devices: Chromebooks where the top row is used for both
+# media and F1-F10 keys.
+
 # To update this file, create a new file
 #   /etc/udev/hwdb.d/70-keyboard.hwdb
 # and add your rules there. To load the new rules execute (as root):
@@ -569,21 +575,6 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHDX9494NR:pvr*
  KEYBOARD_KEY_d8=!f23                                   # touchpad off
  KEYBOARD_KEY_d9=!f22                                   # touchpad on
 
-# Chromebook 14
-# Top row keys (between ESC and power button)
-evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr*
- KEYBOARD_KEY_3b=back
- KEYBOARD_KEY_3c=forward
- KEYBOARD_KEY_3d=refresh
- KEYBOARD_KEY_3f=switchvideomode
- KEYBOARD_KEY_40=brightnessdown
- KEYBOARD_KEY_41=brightnessup
- KEYBOARD_KEY_42=mute
- KEYBOARD_KEY_43=volumedown
- KEYBOARD_KEY_44=volumeup
- KEYBOARD_KEY_db=search # Same position as caps lock key on most keyboards
- # KEYBOARD_KEY_3e=fullscreen, no defined key sym
-
 # HP EliteBook 725 G2
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnHPLicrice:pvr*
 # HP ProBook 440 G2
@@ -1733,3 +1724,13 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadT560s
 # Lenovo ThinkPad X1 Carbon 3rd Gen
 evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX1Carbon3rd
  KEYBOARD_LED_CAPSLOCK=0
+
+######################### FIXED MODEL DEVICES #############################
+# This section lists devices which require special handling in their key
+# code to keysym mapping by setting the xkb model.
+# The model must be an xkb compatible model (defined with XKB_FIXED_MODEL).
+
+# Chromebooks
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:pvr*
+evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnPeppy:pvr*
+ XKB_FIXED_MODEL="chromebook"
index c558687edc2839fc2109f141dd4f00c509216e67..9a933b82b290869d564f2e98630c77b253df723c 100755 (executable)
@@ -123,6 +123,7 @@ def property_grammar():
              ('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))),
              ('XKB_FIXED_LAYOUT', STRING),
              ('XKB_FIXED_VARIANT', STRING),
+             ('XKB_FIXED_MODEL', STRING),
              ('KEYBOARD_LED_NUMLOCK', Literal('0')),
              ('KEYBOARD_LED_CAPSLOCK', Literal('0')),
              ('ACCEL_MOUNT_MATRIX', mount_matrix),