Commit Graph

31 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 4f10b80786 Rename udev's hwdb/ to hwdb.d/
As in the parent commit, this makes the name consistent with the
rest of the source tree and the actuall installation path.
2019-10-10 00:53:09 +01:00
Luís Ferreira 331e34fe1d hwdb: update ACCEL_LOCATION property to use Or instead of QuotedString 2019-05-19 19:51:03 +01:00
Luís Ferreira ccf4784174 hwdb: add ACCEL_LOCATION property to parse_hwdb.py
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2019-04-27 22:12:08 +01:00
Yu Watanabe d8a0bcfd77 tree-wide: drop header for emacs from python scripts 2018-12-10 03:17:33 +09:00
Yu Watanabe af182e786c hwdb: drop unused imported object 2018-12-10 03:06:58 +09:00
Zbigniew Jędrzejewski-Szmek 0cd41d4dff Drop my copyright headers
perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml
git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms'
git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms'
git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
2018-06-14 13:03:20 +02:00
Lennart Poettering 96b2fb93c5 tree-wide: beautify remaining copyright statements
Let's unify an beautify our remaining copyright statements, with a
unicode ©. This means our copyright statements are now always formatted
the same way. Yay.
2018-06-14 10:20:21 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Zbigniew Jędrzejewski-Szmek d74a9adf93 Add SPDX indentifier to hwdb/parse_hwdb.py 2017-11-19 19:08:15 +01:00
Peter Hutterer ffac30349e hwdb: add a hwdb file to override ID_INPUT assignments
The input_id builtin assigns the various ID_INPUT based on the exported evdev
bits. In some cases, the device may not have the properties required to label
a device as one specific type but the physical form factor is clear.
e.g. in the case of #7197 it's a tablet pad that does not have x/y axes which
the kernel exports for pads for historical reasons.

A custom override is needed, best to be solved with a hwdb entry.

Related #7197
2017-10-30 10:57:18 +10:00
Zbigniew Jędrzejewski-Szmek 494d16aa0c hwdb: disallow acceleration matrices with trivial rows
All zeros means that we cannot detect acceleration in that direction.

Related to #6430.
2017-07-22 19:25:43 -04:00
Michal Suchanek c6dce24573 hwdb: support pressing buttons on a keyboard
Support BTN_* codes with btn_ prefix and keys with KEY_ prefix
optionally removed.
2017-06-27 13:28:07 +02:00
hadess c8ec393b25 hwdb: Add ID_INPUT_JOYSTICK_INTEGRATION property (#5413)
When the joystick is integrated directly into the machine, knowing
that the device is internal allows us to disable attached functionality
when the device is not used or inaccessible.

For example, this allows disabling rumble and accelerometer on
flip-console-like devices like the GPD-XD.
2017-06-26 12:17:36 +02:00
Jörg Thalheim 3e67e5c992 more portable python shebangs (#5816)
This is useful on systems like NixOS, where python3 is not in
/usr/bin/python3 as well as for people using alternative ways to
install python such as virtualenv/pyenv.
2017-04-30 20:26:56 -04:00
Bastien Nocera b698b5cf85 hwdb: Add property for keyboards without LEDs
It is useful for desktop environments to be able to show Caps-Lock or
Num-Lock status changes as an on-screen display when using a keyboard
that doesn't have LEDs for this.

Closes: #5559
2017-03-09 14:53:52 +01:00
Peter Hutterer 1a4132ae1d hwdb: add MOUSE_WHEEL_TILT_VERTICAL/HORIZONTAL to the mouse db (#5023)
Plenty of single scroll-wheel mice have the ability to tilt the wheel to
generate horizontal wheel events. They use the same evdev axis as a real
horizontal wheel (REL_HWHEEL) and are indistinguishable to userspace from the
real thing. libinput promises physical degrees for wheel events but that's not
accurate for those tilting wheels, hence mark them as tilting wheels so we can
treat them like the special snowflakes they think they are.
2017-01-05 10:31:51 +01:00
Zbigniew Jędrzejewski-Szmek fe2a2a4f46 hwdb_parser: make sure that our patterns match the full property
We would catch stuff like:
 ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0.0., 0
but not
 ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 0.0.
because the match would stop at the next-to-last char. Fix that
by requiring a line end.
2016-12-10 02:28:24 -05:00
Zbigniew Jędrzejewski-Szmek 7fdc73afe4 hwdb_parser: add support for ACCEL_MOUNT_MATRIX
We test that we have exactly three rows of three reals separated by two
semicolons.
2016-12-10 02:26:37 -05:00
Zbigniew Jędrzejewski-Szmek 8d9d1e3af0 hwdb_parse: adjust indentation and imports following pylint advice
(This commit is separate to make it easy to export to libinput.)
2016-12-01 19:10:01 -05:00
Peter Hutterer 086c001e29 hwdb: add XKB_FIXED_LAYOUT/VARIANT to the keyboard hwdb
Yubikeys and other pseudo keyboards require that they are in the US layout,
otherwise the data they send is invalid. Add two new keys to signal this to
processes that handles (XKB) layouts.
2016-12-01 20:11:54 +10:00
Martin Pitt aeceb3901a hwdb/parse_hwdb.py: open files with UTF-8 mode
pyparsing uses the system locale by default, which in the case of 'C' (in lots
of build environment) will fail with a UnicodeDecodeError. Explicitly open it
with UTF-8 encoding to guard against this.
2016-11-30 09:25:09 +01:00
Martin Pitt f644a6da7a parse_hwdb: fix to work with pyparsing 2.1.10
pyparsing 2.1.10 fixed the handling of LineStart to really just apply to line
starts and not ignore whitespace and comments any more. Adjust EMPTYLINE to
this.

Many thanks to Paul McGuire for pointing this out!
2016-11-30 09:20:15 +01:00
Martin Pitt 2f08ccc32e Revert "hwdb/parse_hwdb.py: open files with UTF-8 mode"
"encoding" is not a valid Python 2 keyword, and despite the hashbang this
script can be called with Python 2.

This reverts commit 115a10c58d.
2016-11-25 07:59:37 +01:00
Martin Pitt 115a10c58d hwdb/parse_hwdb.py: open files with UTF-8 mode
pyparsing uses the system locale by default, which in the case of 'C' (in lots
of build environment) will fail with a UnicodeDecodeError. Explicitly open it
with UTF-8 encoding to guard against this.
2016-11-24 10:38:01 +01:00
Zbigniew Jędrzejewski-Szmek 1258f08898 parse_hwdb: add import fallback for python2 2016-11-02 22:48:43 -04:00
Peter Hutterer 9107a33777 hwdb: add MOUSE_WHEEL_CLICK_COUNT for non-integer click angles (#4440)
MOUSE_WHEEL_CLICK_ANGLE has been an integer, and at least libinput (probably
the only user) parses it as strict integer. For backwards compatibility, we
cannot change it to a decimal number now.

Add a new property to list the number of clicks for a full 360 degree
rotation, to be specified in addition to the old click angle property. Clients
can prefer the new one where available and calculate the decimal value to
whatever precision they want.
2016-10-21 12:31:32 +02:00
Zbigniew Jędrzejewski-Szmek acb986015d Relicense hwdb/parse_hwdb.py as MIT (#4129)
This parser will also be used in libinput, which uses the MIT license, so
relicense this file to the more permissive license to make bidirectional code
flow easier. parse_hwdb.py is only useful during building of the project, and
is not part of the installation, so effectively both licenses are very similar.
In particular, the licensing of binary packages produced by systemd is not
influenced in any way, because the MIT licensed part is not installed.
2016-09-13 08:18:13 +02:00
Lennart Poettering a6a8e60bd3 hwdb: let's no abbreivate HORIZONTAL as HORIZ (#3994)
I think I am developing OCD... Let's fix this before this actually gets used in
the wild.

A follow-up for #3986 (5fc9e4abb4).
2016-08-19 15:31:36 +02:00
Peter Hutterer 5fc9e4abb4 hwdb: add a udev property for a wheel click angle on horiz wheels
The Logitech MX Master has a horizontal scroll wheel with a different click
angle than the vertical one. Add a new property for this case, we can't add
values to the normal one without risking upsetting existing parsers.

Fixes #3947
2016-08-19 11:57:36 +10:00
Zbigniew Jędrzejewski-Szmek c3f6a561e2 build-sys: hook up the hwdb parser to check 2016-08-09 00:42:52 -04:00
Zbigniew Jędrzejewski-Szmek 0c9836c0cf tests: add python parser for hwdb grammar
This works for hwdb/[67]0-*.hwdb. I also added code to parse hwdb/20-*, but those
files are huge, and parsing them using this parser is annoyingly slow (about one
minute for the biggest files). So I removed the support for hwdb/20-*, a much simpler
hand-generated parser should suffice for those.

Current output:

hwdb/60-evdev.hwdb: 24 match groups, 35 matches, 88 properties, 0.19323015213012695s to parse
Match 'evdev:input:b0003v05ACp0259*' is duplicated
Match 'evdev:input:b0003v05ACp025A*' is duplicated
Match 'evdev:input:b0003v05ACp025B*' is duplicated
hwdb/60-keyboard.hwdb: 122 match groups, 188 matches, 638 properties, 1.0906572341918945s to parse
Failed to parse: 'KEYBOARD_KEY_8F=switchvideomode'
Failed to parse: 'KEYBOARD_KEY_C0183=media'
Failed to parse: 'KEYBOARD_KEY_C0201=new'
Failed to parse: 'KEYBOARD_KEY_C0289=reply'
Failed to parse: 'KEYBOARD_KEY_C028B=forwardmail'
Failed to parse: 'KEYBOARD_KEY_C028C=send'
Failed to parse: 'KEYBOARD_KEY_C021A=undo'
Failed to parse: 'KEYBOARD_KEY_C0279=redo'
Failed to parse: 'KEYBOARD_KEY_C0208=print'
Failed to parse: 'KEYBOARD_KEY_C0207=save'
Failed to parse: 'KEYBOARD_KEY_C0194=file'
Failed to parse: 'KEYBOARD_KEY_C01A7=documents'
Failed to parse: 'KEYBOARD_KEY_C01B6=images'
Failed to parse: 'KEYBOARD_KEY_C01B7=sound'
Property KEYBOARD_KEY_c7 is duplicated
Failed to parse: 'KEYBOARD_KEY_cF=end'
hwdb/70-mouse.hwdb: 62 match groups, 93 matches, 68 properties, 0.34186625480651855s to parse
Match 'mouse:usb:v046dpc51b:name:Logitech USB Receiver:' is duplicated
hwdb/70-pointingstick.hwdb: 5 match groups, 14 matches, 7 properties, 0.06518816947937012s to parse
hwdb/70-touchpad.hwdb: 3 match groups, 5 matches, 3 properties, 0.039690494537353516s to parse

Subsequest commits will clean those issues up.
2016-08-09 00:42:52 -04:00