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>
Just enabling EV_REP sets them to zero, but when enabling them directly,
a value is required.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Except for the API documentation, that'll stay on github for now until
I figure out where to put it (and have the space to put it in).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These aren't really that useful since they're just one or two lines in
code, but it saves callers from accidentally misplacing braces, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Not all clients need nonblocking read, so add a flag to read
in blocking mode. In that mode, events are only read from the fd when
the queue is empty.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We can't enable axes on devices at runtime in the kernel, not even
for uinput devices. So this API can't work anyway, remove it before
someone thinks it does work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
uinput doesn't route a SYN_DROPPED, so we neeed to handle fds in
a rather complicated manner. For tests, avoid this and instead force
the library to sync if a specific flag is given.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Doxygen is bad for man pages, but having an online API documentation
is better and easier to maintain.
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>
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>