Find a file
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
doc doc: include linux/input.h verbatim in the documentation 2014-03-14 09:38:18 +10:00
include/linux include: update linux/input.h for kernel 3.13 2014-01-22 09:15:14 +10:00
libevdev Drain all events before synchronizing after SYN_DROPPED 2014-04-24 08:17:01 +10:00
m4 Review/update .gitignore files 2013-11-19 09:34:23 +10:00
test Drain all events before synchronizing after SYN_DROPPED 2014-04-24 08:17:01 +10:00
tools tools: Fix compiler warning 2014-02-26 07:24:46 +10:00
.gitignore Review/update .gitignore files 2013-11-19 09:34:23 +10:00
autogen.sh autogen.sh: remove unneeded m4 configuration workaround 2013-11-19 09:37:06 +10:00
configure.ac libevdev 1.1 2014-03-25 16:20:24 +10:00
COPYING Update COPYING file. 2013-11-15 09:30:10 +10:00
libevdev.pc.in Fix name and version in pkgconfig file 2013-07-24 07:27:17 +10:00
Makefile.am Pass --no-print-directory to make 2013-08-26 07:59:07 +10:00
README.md README: remove the warning, it's stable now 2014-02-11 16:27:50 +10:00

libevdev - wrapper library for evdev input devices

libevdev is a wrapper library for evdev devices. it moves the common tasks when dealing with evdev devices into a library and provides a library interface to the callers, thus avoiding erroneous ioctls, etc.

git://git.freedesktop.org/git/libevdev http://cgit.freedesktop.org/libevdev/

The eventual goal is that libevdev wraps all ioctls available to evdev devices, thus making direct access unnecessary.

Go here for the API documentation: http://www.freedesktop.org/software/libevdev/doc/latest/

File bugs in the freedesktop.org bugzilla: https://bugs.freedesktop.org/enter_bug.cgi?product=libevdev

Patches, questions and general comments should be submitted to the input-tools@lists.freedesktop.org mailing list: http://lists.freedesktop.org/mailman/listinfo/input-tools