test: change device for enabling/disabling bits to use REL_*

No real effect on the test, this check is just so that a follow-up patch to
fix the tests for the new uinput backend is a bit easier to review.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Make the tests optional to drop unneeded dependencies

libevdev has no external dependencies and both check and libudev are
only required for running the unit-tests. Make them optional.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
test: devices with abs axes need to be created properly

Simply enabling the bits is not enough, we need to provide axis
information too if we want to enable this properly.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Simplify a bit state setter

set_bit_state does exactly what the previous if/else did.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Sync the key state on startup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Rename libevdev_kernel_set_abs_value to libevdev_kernel_set_abs_info

Keep it in line with the non-kernel setter

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add setters for an event or slot value

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Keep the LED state and sync it after SYN_DROPPED

This enables libevdev_get_event_value(dev, EV_LED, LED_NUML); to check
if a LED is on or off.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Add functions to toggle LEDs on the device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
write EV_SYN input_event along with led events to device

Other clients of an evdev device need to have the events they receive
be separated, in moment in time, from other events by an EV_SYN/
SYN_REPORT. This is the responsibility of the client who writes events
into the stream.
Typedef the enums instead of using enums directly.

This would allow us to - in the future - switch the type without breaking
API, though it's unlikely that we'll ever need this. It's still nicer to
read IMO.

This is technically an API, but not an ABI change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>