Add a code-based name lookup function
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 19 Mar 2019 01:44:33 +0000 (11:44 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Thu, 21 Mar 2019 00:55:32 +0000 (00:55 +0000)
commit9fe185dd3d4d43929a36af351013909b52ce3416
tree28eaf18ba592c82609c2875cfa9c3f6547806a93
parent76662deeff46090d1009d76dda06767af4d45511
Add a code-based name lookup function

Two new function pairs:
libevdev_event_code_from_code_name()
libevdev_event_type_from_code_name()

libevdev_event_code_from_code_name_n()
libevdev_event_type_from_code_name_n()

These functions look up event codes/types by the name of the event code only,
removing the need to figure out what event type an event code has. So if all
you have is "BTN_TOUCH", you can now look up the type and code for that,
without having to check the prefix yourself to guess at the type.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev-names.c
libevdev/libevdev.h
libevdev/libevdev.sym
test/test-event-codes.c