Commit graph

32 commits

Author SHA1 Message Date
Peter Hutterer
4ba56ac309 test: add two more checks for the current slot
When syncing, we expect the slot to stay the same until the client has
processed the events. This already worked, just add a check to make sure.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-06 09:21:02 +10:00
Peter Hutterer
f3f31b47fc Increase MAX_SLOTS to 60
As seen on 3M devices, which seems to be the maximum seen so far. Some Stantum
devices report 255 touches but are only capable of 10, so the are not affected
by our limits.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-03-06 09:21:02 +10:00
Peter Hutterer
d596bd7a32 test: add a test for > MAX_SLOTS mt values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2014-03-06 09:21:02 +10:00
Peter Hutterer
b08ed615d3 test: whitespace fixes (newlines)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 19:16:08 +10:00
Peter Hutterer
05c061c2bc test: plug more memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-02-27 13:19:12 +10:00
Peter Hutterer
642c91fc6a Warn about a SYN_DROPPED right after finishing a sync
If the first event after a completed device sync is a SYN_DROPPED, warn the
user that they're not fast enough handling this device.

The test for this is rather complicated since we can't write SYN_DROPPED
through uinput so we have to juggle the device fd and a pipe and switch
between the two at the right time (taking into account that libevdev will read
events from the fd whenever it can).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22 09:15:14 +10:00
Peter Hutterer
4eeda3bc47 test: fix typo
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-17 10:54:58 +10:00
Peter Hutterer
650f372c90 test: rename a test to match what it's testing better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-17 10:54:58 +10:00
Peter Hutterer
714c2ffa9e Merge branch 'ev-rep-handling' 2013-12-09 09:49:43 +10:00
Peter Hutterer
f66bf57baa State that the event is defined for a SYN_DROPPED
All clients that want to handle SYN_DROPPED correctly need to pass an EV_SYN
through their own handlers before starting with the syn events. Rather than
letting them synthesize that, guarantee that the event is defined the first
time LIBEVDEV_READ_STATUS_SYNC is returned.

This does not change existing behavior, it merely documents it so we can rely
on it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-12-09 09:49:28 +10:00
Peter Hutterer
a2f842bb8a Support EV_REP values through libevdev_get_event_value
We shouldn't have a separate API for that, the whole point of libevdev is to
abstract the quirkyness of the ioctls into a common interface. So let's
export the two EV_REP values through libevdev_get_event_value.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
2013-12-09 09:49:15 +10:00
Peter Hutterer
661602fe3b Name-space the read flags better
Rename from LIBEVDEV_READ_foo to LIBEVDEV_READ_FLAG_foo to differentiate
better from LIBEVDEV_READ_STATUS_foo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11 12:10:15 +10:00
Peter Hutterer
5d2fc78138 Enumerate libevdev_next_event() return codes
Improved readability in callers, changing magic numbers 0 and 1 to

rc = libevdev_next_event();
if (rc == LIBEVDEV_READ_STATUS_SUCCESS)
    do_something();
else if (rc == LIBEVDEV_READ_STATUS_SYNC)
    do_something_else()

No ABI changes, the enum values are the previously documented values,
this is just a readability improvement.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-09-11 12:10:12 +10:00
Peter Hutterer
69f89c8877 test: update to test for the various _MAX values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-31 09:40:41 +10:00
Peter Hutterer
a8871e7aea Use AC_USE_SYSTEM_EXTENSIONS
Defines _GNU_SOURCE for us.
http://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Posix-Variants.html

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-29 13:54:50 +10:00
Peter Hutterer
b20becc942 Add support for EV_SW
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-29 11:13:47 +10:00
Peter Hutterer
edc31cf12e Store the abs value after handling mt events
This way any ABS_MT_ event value that comes in will also be stored in abs_info.
That always corresponds to "current slot", so if a user calls
libevdev_set_event_value() or libevdev_get_event_value() they're actually
modifying the current slot value.

When the current slot changes, sync the state back into the absinfo values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-26 09:52:33 +10:00
Peter Hutterer
bfb6c1c6c5 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>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-15 10:32:40 +10:00
Peter Hutterer
74d9b4c72d Add setters for an event or slot value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-15 10:32:37 +10:00
Peter Hutterer
a28473cb62 Add libevdev_has_event_pending()
Returns non-zero if there are events avialable to be read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-08-01 13:53:04 +10:00
Peter Hutterer
33d0fff566 test: add a few sync test cases for incomplete syncs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-02 14:02:58 +10:00
Peter Hutterer
d347e7d4e4 test: add test for abs and mt syncing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-01 14:40:22 +10:00
Peter Hutterer
592d5167e4 test: add tests for mt event values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-01 13:36:23 +10:00
Peter Hutterer
f7c580976c test: add tests for checking event values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-01 13:36:20 +10:00
Peter Hutterer
3ad61372c8 test: add test for filtered event delivery
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-01 10:10:25 +10:00
Peter Hutterer
f456a9dce4 test: use new convenience function for uinput device creation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:19:50 +10:00
Peter Hutterer
a30f4cfa8a test: prepare a common header file for all tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-29 18:00:42 +10:00
Peter Hutterer
20fb3fc875 test: close the right pipe fds
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-28 13:15:27 +10:00
Peter Hutterer
e8f059f235 test: fix a bunch of memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-28 13:13:55 +10:00
Peter Hutterer
9ddd477f62 test: add test case for button deltas after SYN_DROPPED
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-28 11:25:51 +10:00
Peter Hutterer
627b33cfe7 Require a flag for normal mode too
Makes the whole thing more explicit.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 14:20:03 +10:00
Peter Hutterer
671a1e2feb test: add test for event polling and SYN_DROPPED handling
Rudimentary only, but it's a start

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 13:32:38 +10:00