mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-22 00:50:07 +01:00
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> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| libevdev-int.h | ||
| libevdev-names.c | ||
| libevdev-uinput-int.h | ||
| libevdev-uinput.c | ||
| libevdev-uinput.h | ||
| libevdev-util.h | ||
| libevdev.c | ||
| libevdev.h | ||
| libevdev.sym | ||
| make-event-names.py | ||
| Makefile.am | ||