summaryrefslogtreecommitdiff
path: root/libevdev/make-event-names.py
Commit message (Collapse)AuthorAgeFilesLines
* make-event-names: Fix determinism issueRichard Purdie2021-02-221-3/+3
| | | | | | | | | | | The order of dict values is not deterministic in python leading to differing  header file generation which results in differing build output for the same configuration. Sort to remove this inconsistency and make the output  reproducible. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Reviewed-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Use editorconfig instead of a sprinkling of :vim: instructionsPeter Hutterer2020-02-271-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* flake8 fixes for make-event-names.pyPeter Hutterer2020-02-141-165/+178
| | | | | | | Mostly whitespace changes, two semicolon removals and one change to "foo is None". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Change the python script to generate event names to Python3Peter Hutterer2020-02-141-2/+1
| | | | | | It's well past time. If you need this to run on python2, patch it out locally. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Only use GCC pragma on GCCMichael Forney2020-02-051-2/+2
| | | | Signed-off-by: Michael Forney <mforney@mforney.org>
* Avoid initializer index rangeMichael Forney2020-02-051-5/+7
| | | | | | | | This is a GNU C extension, and is not available in ISO C. Instead, just explicitly initialize other indices to -1. Signed-off-by: Michael Forney <mforney@mforney.org>
* make-event-names.py should take the files as argumentPeter Hutterer2019-10-231-6/+6
| | | | | | Don't rely on cat, just let our script read everything as required. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* include: sync event codes with kernel 4.19Peter Hutterer2018-10-221-1/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add libevdev_event_value_get_name() to resolve ABS_MT_TOOL_TYPE valuesPeter Hutterer2018-07-091-2/+8
| | | | | | | | | | ABS_MT_TOOL_TYPE values are an enum, not a numerical value like all other axes. So let's allow converting those values to string. Fixes https://gitlab.freedesktop.org/libevdev/libevdev/issues/1 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Resolve the names "SW_MAX" and friendsPeter Hutterer2018-07-091-4/+14
| | | | | | | | | | Some of the *_MAX names are duplicates and have a real define. These were not resolved until now. Fixes https://gitlab.freedesktop.org/libevdev/libevdev/issues/3 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* make-event-names: minor cleanups for readabilityPeter Hutterer2018-07-091-6/+6
| | | | | | | | Two variable renames for less ambiguity Two changes from an long if condition to a "if foo in [...]" Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Blacklist SW_MAX so it doesn't shadow SW_PEN_INSERTEDPeter Hutterer2018-02-261-0/+1
| | | | | | | | | | | | | | | | | They have the same value, so the _MAX code would shadow the real code, causing issues in any client that needs to get all event names from libevdev. Specifically, the loop of: for each code in 0 to max-for-type: print(name) would not show up the code (but the _MAX) code instead. This causes issues with clients that rely on name resolution that works. And the _MAX values are special values anyway. Blacklist it in the script here, causing it to resolve from name to code, but not from code to name (like other duplicated codes). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Blacklist REP_MAX so it doesn't shadow REP_PERIODPeter Hutterer2018-02-261-1/+2
| | | | | | | | | | | | | | They have the same value, so the _MAX code would shadow the real code, causing issues in any client that needs to get all event names from libevdev. Specifically, the loop of: for each code in 0 to max-for-type: print(name) would not show up the code (but the _MAX) code instead. This causes issues with clients that rely on name resolution that works. And the _MAX values are special values anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Drop the python map printingPeter Hutterer2018-02-261-12/+0
| | | | | | | leftover from when this was part of evemu Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Add parsing linux/input-event-codes.h, update to kernel v4.5Peter Hutterer2016-03-301-5/+4
| | | | | | | | | | The kernel has split most of the event codes out to a new header but the FF_ bits are missing from that header. Until this is fixed upstream, change the event code parsing so it can take two files (using cat and stdin) so we can update the kernel headers again. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Shut up clang compiler warningsPeter Hutterer2015-01-071-0/+9
| | | | | | | | clang looks at GCC pragmas, but doesn't understand -Woverride-init. Instead, it uses -Winitializer-overrides. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Add libevdev_property_from_name()Peter Hutterer2014-08-201-1/+4
| | | | | | | | | 12717d79 "Add libevdev_event_type/code_from_name() resolvers" added the lookup functions for types and codes, this commit adds the missing ones for input properties. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Drop the argparse requirement for make-event-names.pyPeter Hutterer2014-01-151-9/+10
| | | | | | | | | We only take one option (path to linux/input.h) anyway so drop the argparse requirement. This way libevdev builds on RHEL6 too which doesn't ship argparse. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Drop --output flag and python generation code from make-event-names.pyPeter Hutterer2014-01-151-41/+1
| | | | | | | | This is a leftover from when the file was in evemu and used to generate python headers too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* include: update linux/input.h for kernel 3.12Peter Hutterer2014-01-091-4/+0
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Create event type/code lookup tablesDavid Herrmann2013-10-311-4/+59
| | | | | | | | | | | | | Additionally to type->string mapping tables we now also create string->type lookup tables. The lookup tables are sorted by their name so binary-search will work. We create one lookup table for EV_* types and one for all event-codes. More tables (like bus-names, input-properties, ..) can be added later. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Pass linux/input.h as argument to make-event-names.pyPeter Hutterer2013-10-231-6/+5
| | | | | | Rather than a hardcoded path inside the source. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Match the kernel define for SYN_MAXPeter Hutterer2013-09-041-1/+3
| | | | | | | | | Will be defined as 0xf in 3.12, see http://git.kernel.org/cgit/linux/kernel/git/dtor/input.git/commit/?h=next&id=52764fed5049655926bcecaefd52f0a415ceb105 And add the required ifdef guards for kernels before that. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Ignore -Woverride-init in event-names.hPeter Hutterer2013-08-291-2/+3
| | | | | | | | | | | | Having the declarations in the form of [0...EV_MAX] = NULL together with the actual definitions causes warnings for every true definition if -Woverride-init is enabled. We can drop them for most as they're zero, but still need them for ev_max (which defaults to -1), not zero. So use the GCC pragma to disable the warnings for this file. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Change event name generate script to be python 2/3 compatiblePeter Hutterer2013-08-291-47/+48
| | | | | | | | | | | | | | | | | | Python 3 doesn't have a print statement, only a print function. Fixed with: 2to3 make-event-names.py | git apply Print as function requires Python 2.6 which is reasonable enough given that even RHEL6 ships that. Even though it's not needed for 2.6, use from __future__ import print_function to avoid accidentally introducing a print statement in the future. With this line, print "blah" is now a syntax error in python 2. This line was added manually, after the 2to3 conversion. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Handle EV_REP events in event-names.hPeter Hutterer2013-06-261-0/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Default to a max of -1 for undefined EV_foo bitsPeter Hutterer2013-06-261-0/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Blacklist some key names that resolve to other namesPeter Hutterer2013-06-041-1/+8
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Expose API for retrieving event namesPeter Hutterer2013-06-041-0/+178
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>