libevdev/libevdev
Peter Hutterer 050bca91a1 Drain all events before synchronizing after SYN_DROPPED
The kernel ring buffer drops all events on SYN_DROPPED, but then continues to
fill up again. So by the time we read the events, the kernel's client buffer is
essentially like this:
  SYN_DROPPED, ev1, ev2, ev3, ...., evN

The kernel's device state represents the device after evN, and that is what
the ioctls return. For EV_KEY, EV_SND, EV_LED and EV_SW the kernel removes
potential duplicates from the client buffer [1], it doesn't do so for EV_ABS.

So we can't actually sync while there are events on the wire because the
events represent an earlier state. So simply discard all events in the kernel
buffer, synchronize, and then start processing again. We lose some granularity
but at least the events are correct.

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/input/evdev.c?id=483180281f0ac60d1138710eb21f4b9961901294

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-04-24 08:17:01 +10:00
..
.gitignore Review/update .gitignore files 2013-11-19 09:34:23 +10:00
libevdev-int.h Drop hardcoded MAX_SLOTS in favour of pre-allocated memory 2014-04-03 13:30:49 +10:00
libevdev-names.c Provide separate lookup functions for zero-terminated strings 2013-11-01 08:18:41 +10:00
libevdev-uinput-int.h Add support for uinput device creation 2013-08-29 13:54:46 +10:00
libevdev-uinput.c uinput: check for asprintf failure 2014-03-19 09:36:41 +10:00
libevdev-uinput.h More documentation fixes and improvements 2014-02-12 16:01:10 +10:00
libevdev-util.h Move some functions/macros between libevdev-int.h and libevdev-util.h 2014-03-06 14:30:03 +10:00
libevdev.c Drain all events before synchronizing after SYN_DROPPED 2014-04-24 08:17:01 +10:00
libevdev.h Drain all events before synchronizing after SYN_DROPPED 2014-04-24 08:17:01 +10:00
libevdev.sym Add ld version-script 2014-01-29 15:02:40 +10:00
make-event-names.py Drop the argparse requirement for make-event-names.py 2014-01-15 08:01:31 +10:00
Makefile.am Add ld version-script 2014-01-29 15:02:40 +10:00