summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Wick <sebastian@sebastianwick.net>2019-10-31 14:27:24 +0100
committerLennart Poettering <lennart@poettering.net>2019-11-05 10:08:26 +0100
commitd7d31692bf7cde5dce7f4ed3cae429a5b302a9f0 (patch)
tree969d3743e32212a9b678c2ce8fb97e14dca4588a
parentd36b573ef7a5a872cc5a4079cb1961e0d066a7b2 (diff)
downloadsystemd-d7d31692bf7cde5dce7f4ed3cae429a5b302a9f0.tar.gz
hwdb: add XKB_FIXED_MODEL to the keyboard hwdb
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.
-rw-r--r--hwdb.d/60-keyboard.hwdb33
-rwxr-xr-xhwdb.d/parse_hwdb.py1
2 files changed, 18 insertions, 16 deletions
diff --git a/hwdb.d/60-keyboard.hwdb b/hwdb.d/60-keyboard.hwdb
index 15f0a970b6..9227bee7ff 100644
--- a/hwdb.d/60-keyboard.hwdb
+++ b/hwdb.d/60-keyboard.hwdb
@@ -75,7 +75,13 @@
# 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"
diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py
index c558687edc..9a933b82b2 100755
--- a/hwdb.d/parse_hwdb.py
+++ b/hwdb.d/parse_hwdb.py
@@ -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),