make-event-names: drop C header generation

If you're dealing with C, use libevdev.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
 - edited python/evemu/Makefile.am to remove the unused arguments
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
make-event-names: ignore ioctl defines

These were currently filtered a few lines below when a ValueError occured
converting them to the integer value. In a few patches, that part will change,
so let's ignore ioctl defines explicitly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
make-event-names: allow for one-way mappings

BTN_MISC and others are currently dropped, but if we want to support
string->value mappings we need to parse those correctly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
make-event-names: handle aliases for event code defines

Some codes are defined as aliases, e.g.
 #define BTN_A BTN_SOUTH

Handle those as one-way conversions, so we get the right value from the string
when requested.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
make-event-names: make the type-to-map mapping string-compatible

One less indirection, map["EV_KEY"] returns the right map now

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
make-event-names: replace get_code/type_name functions with a unified set

Python has default arguments, so we can have a function that does the right
thing depending on the arguments passed in. And have two functions that
explicitly fetch the name, or value, for an event.

So now we can do things like
  t = event_get_value("EV_ABS")
  c = event_get_value("EV_ABS", "ABS_X")
  t = event_get_name(0x02)
  c = event_get_name(0x02, 0x03)
  c = event_get_name("EV_ABS", 0x03)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
python: move make-event-names to the python directory

Nothing in the C code uses it anymore

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
python: fix a typo

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
python: add top-level wrappers for getting code/type names and values

Rather than having those hidden in a submodule, expose them as evemu
functions, with a defined behaviour and different naming for getting
values vs names.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
python: allow strings as event codes/types in evemu.Device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>