summaryrefslogtreecommitdiff
path: root/hwdb.d
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-21 11:34:39 +0200
committerGitHub <noreply@github.com>2020-10-21 11:34:39 +0200
commit9d7b11fdc8cd321af2686594067800dc9dd60ff0 (patch)
tree136b50be24db06b8b3bf239a32dcfd8d5c8fd575 /hwdb.d
parentaa5502bb336fdc4546e564c60d36b3d4e7909bc7 (diff)
parent327d8f3ab8dc14189ecb0ca29d3107699fec4d9d (diff)
downloadsystemd-9d7b11fdc8cd321af2686594067800dc9dd60ff0.tar.gz
Merge pull request #17395 from keszybz/hwdb-drop-quotes
hwdb: drop quotes from XKB_FIXED_*= properties
Diffstat (limited to 'hwdb.d')
-rw-r--r--hwdb.d/60-keyboard.hwdb12
-rwxr-xr-xhwdb.d/parse_hwdb.py13
2 files changed, 13 insertions, 12 deletions
diff --git a/hwdb.d/60-keyboard.hwdb b/hwdb.d/60-keyboard.hwdb
index 66672c5b53..97800f4364 100644
--- a/hwdb.d/60-keyboard.hwdb
+++ b/hwdb.d/60-keyboard.hwdb
@@ -72,14 +72,14 @@
# A device with a fixed keyboard layout that must not be changed by
# the desktop environment may specify that layout as:
-# XKB_FIXED_LAYOUT="us"
-# XKB_FIXED_VARIANT=""
+# XKB_FIXED_LAYOUT=us
+# 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"
+# XKB_FIXED_MODEL=xkbmodel
# Examples of such devices: Chromebooks where the top row is used for both
# media and F1-F10 keys.
@@ -1796,8 +1796,8 @@ evdev:input:b0003v1050p0111:*
evdev:input:b0003v1050p0116:*
# OKE Electron Company USB barcode reader
evdev:input:b0003v05FEp1010:*
- XKB_FIXED_LAYOUT="us"
- XKB_FIXED_VARIANT=""
+ XKB_FIXED_LAYOUT=us
+ XKB_FIXED_VARIANT=
######################### LACK OF MODIFIER LEDS ############################
# This section lists keyboard which do not have their own LEDs for some
@@ -1846,4 +1846,4 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX1Carbon3rd:*
# Chromebooks
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pnFalco:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pnPeppy:*
- XKB_FIXED_MODEL="chromebook"
+ XKB_FIXED_MODEL=chromebook
diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py
index 09751634a4..4174c7598f 100755
--- a/hwdb.d/parse_hwdb.py
+++ b/hwdb.d/parse_hwdb.py
@@ -32,7 +32,7 @@ try:
from pyparsing import (Word, White, Literal, ParserElement, Regex, LineEnd,
OneOrMore, Combine, Or, Optional, Suppress, Group,
nums, alphanums, printables,
- stringEnd, pythonStyleComment, QuotedString,
+ stringEnd, pythonStyleComment,
ParseBaseException)
except ImportError:
print('pyparsing is not available')
@@ -54,7 +54,6 @@ EOL = LineEnd().suppress()
EMPTYLINE = LineEnd()
COMMENTLINE = pythonStyleComment + EOL
INTEGER = Word(nums)
-STRING = QuotedString('"')
REAL = Combine((INTEGER + Optional('.' + Optional(INTEGER))) ^ ('.' + INTEGER))
SIGNED_REAL = Combine(Optional(Word('-+')) + REAL)
UDEV_TAG = Word(string.ascii_uppercase, alphanums + '_')
@@ -94,7 +93,8 @@ def hwdb_grammar():
matchline = (matchline_typed | matchline_general) + EOL
propertyline = (White(' ', exact=1).suppress() +
- Combine(UDEV_TAG - '=' - Word(alphanums + '_=:@*.!-;, "') - Optional(pythonStyleComment)) +
+ Combine(UDEV_TAG - '=' - Optional(Word(alphanums + '_=:@*.!-;, "'))
+ - Optional(pythonStyleComment)) +
EOL)
propertycomment = White(' ', exact=1) + pythonStyleComment + EOL
@@ -114,6 +114,7 @@ def property_grammar():
dpi_setting = (Optional('*')('DEFAULT') + INTEGER('DPI') + Suppress('@') + INTEGER('HZ'))('SETTINGS*')
mount_matrix_row = SIGNED_REAL + ',' + SIGNED_REAL + ',' + SIGNED_REAL
mount_matrix = (mount_matrix_row + ';' + mount_matrix_row + ';' + mount_matrix_row)('MOUNT_MATRIX')
+ xkb_setting = Optional(Word(alphanums + '+-/@._'))
props = (('MOUSE_DPI', Group(OneOrMore(dpi_setting))),
('MOUSE_WHEEL_CLICK_ANGLE', INTEGER),
@@ -138,9 +139,9 @@ def property_grammar():
('POINTINGSTICK_CONST_ACCEL', REAL),
('ID_INPUT_JOYSTICK_INTEGRATION', Or(('internal', 'external'))),
('ID_INPUT_TOUCHPAD_INTEGRATION', Or(('internal', 'external'))),
- ('XKB_FIXED_LAYOUT', STRING),
- ('XKB_FIXED_VARIANT', STRING),
- ('XKB_FIXED_MODEL', STRING),
+ ('XKB_FIXED_LAYOUT', xkb_setting),
+ ('XKB_FIXED_VARIANT', xkb_setting),
+ ('XKB_FIXED_MODEL', xkb_setting),
('KEYBOARD_LED_NUMLOCK', Literal('0')),
('KEYBOARD_LED_CAPSLOCK', Literal('0')),
('ACCEL_MOUNT_MATRIX', mount_matrix),