If a client doesn't care about syncing that's one thing, but
libevdev functions still need to return the right _current_ (i.e. synced)
value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Enum values fo 3 and 4 to avoid callers using true/false values for grabbing
and ungrabbing. If the evdev mute ioctl is merged, we can extend this
without having to worry about breaking callers.
[1] http://lwn.net/Articles/476830/
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev_new() can only fail on allocation failures, but with an fd the
failure options are more. Split into a new function that can return an error
code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ideally, we could sync by pre-pending all the sync events and then pretend
nothing happened but our queue is too small and likely too full for any
extra events. So drop all events, then add the sync events to the queue.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Provide a couple of handler functions to avoid erroneous queue updates. This
will make it easier if we need to swap queue implementation later.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Callbacks looked good on paper, but synaptics ran into an issue already that
it just couldn't easily pass around the state needed in the actual event
processing function.
Replace with a new interface that only returns the next event (still reading
more off the fd while doing so).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Two main goals of this library:
- 'transparently' handle SYN_DROPPED events
- avoid errors in ioctl handling by providing a simpler interface.
Keeps a cached copy of the device for quick querying.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>