summaryrefslogtreecommitdiff
path: root/hwdb
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2017-06-07 15:28:18 +0200
committerMichal Suchanek <msuchanek@suse.de>2017-06-27 13:28:07 +0200
commitc6dce245735076ae2eb09aaca946e226f722581c (patch)
tree646dbb7061b019f24c90b17b53805d83673ef854 /hwdb
parent1b833237198ae8bcba38c4824dc849b402eab163 (diff)
downloadsystemd-c6dce245735076ae2eb09aaca946e226f722581c.tar.gz
hwdb: support pressing buttons on a keyboard
Support BTN_* codes with btn_ prefix and keys with KEY_ prefix optionally removed.
Diffstat (limited to 'hwdb')
-rw-r--r--hwdb/60-keyboard.hwdb2
-rwxr-xr-xhwdb/parse_hwdb.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index e8be567166..43cb23da32 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -58,6 +58,8 @@
# KEYBOARD_KEY_<hex scan code>=<key code identifier>
# The scan code should be expressed in hex lowercase. The key codes
# are retrieved and normalized from the kernel input API header.
+# Keycodes are either KEY_* defines in lowercase with the key_ prefix
+# optionally removed or BTN_ defines in lowercase with btn_ preserved.
#
# An '!' as the first character of the key identifier string
# will add the scan code to the AT keyboard's list of scan codes
diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py
index 23809a9f1f..c7b49b83df 100755
--- a/hwdb/parse_hwdb.py
+++ b/hwdb/parse_hwdb.py
@@ -172,7 +172,9 @@ def check_one_keycode(prop, value):
if value != '!' and ecodes is not None:
key = 'KEY_' + value.upper()
if key not in ecodes:
- error('Keycode {} unknown', key)
+ key = value.upper()
+ if key not in ecodes:
+ error('Keycode {} unknown', key)
def check_properties(groups):
grammar = property_grammar()