summaryrefslogtreecommitdiff
path: root/libevdev
Commit message (Collapse)AuthorAgeFilesLines
* Actually filter by log priorityPeter Hutterer2014-02-131-1/+1
| | | | | | | | If a message is higher than the current priority, filter it. And add a few tests that the priority is handled the way it should. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Use 0 instead of "zero"Peter Hutterer2014-02-121-7/+7
| | | | | | | | We're a bit inconsistent here anyway because of the ample use of "non-zero" which can't really be converted to non-0. But let's at least be consistent with the use of 0 instead of zero. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* More documentation fixes and improvementsPeter Hutterer2014-02-122-31/+58
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Mark a few more functions as signal-safePeter Hutterer2014-02-121-0/+14
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Improve the documentation a bitPeter Hutterer2014-02-111-11/+24
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Document that we don't support EVIOCREVOKEPeter Hutterer2014-02-111-0/+3
| | | | | | | This is intentional, see http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add ld version-scriptDavid Herrmann2014-01-292-2/+108
| | | | | | | | | | | | | | | | | | | | | Explicit symbol versioning allows us to provide multiple versions of incompatible API changes. It is a very common practice in GNU world and avoids the problems occuring if distributions try to ship multiple version of a single DSO. Background information available at: http://people.redhat.com/drepper/dsohowto.pdf To see the symbol-versions, use objdump: objdump -T libevdev/.libs/libevdev.so.1.0.0 This can also be used to verify that all symbols are correctly exported (typos in linker-scripts are silently ignored by ld). Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Updated for evdev 0.6's API. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Warn about a SYN_DROPPED right after finishing a syncPeter Hutterer2014-01-221-3/+8
| | | | | | | | | | | | If the first event after a completed device sync is a SYN_DROPPED, warn the user that they're not fast enough handling this device. The test for this is rather complicated since we can't write SYN_DROPPED through uinput so we have to juggle the device fd and a pipe and switch between the two at the right time (taking into account that libevdev will read events from the fd whenever it can). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Count the number of events needed for a full syncPeter Hutterer2014-01-221-4/+30
| | | | | | | | | Make sure we have a queue that is at least large enough to do a full sync after a SYN_DROPPED, plus store a few extra events in case some came in after the sync. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Drop the argparse requirement for make-event-names.pyPeter Hutterer2014-01-151-9/+10
| | | | | | | | | We only take one option (path to linux/input.h) anyway so drop the argparse requirement. This way libevdev builds on RHEL6 too which doesn't ship argparse. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* Drop --output flag and python generation code from make-event-names.pyPeter Hutterer2014-01-152-42/+2
| | | | | | | | This is a leftover from when the file was in evemu and used to generate python headers too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
* include: update linux/input.h for kernel 3.12Peter Hutterer2014-01-091-4/+0
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* test: detect if we're running inside gdb and disable forkingPeter Hutterer2013-12-241-2/+3
| | | | | | | | | The Check test framework forks by default which is annoying when running gdb. Try to detect whether we're inside gdb by ptracing ourselves. If that works, we're not inside a debugger. If it doesn't, then assume we're inside a debugger and set CK_FORK to "no". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Documentation rewordings and additionsPeter Hutterer2013-12-241-6/+9
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Documentation typo fixesPeter Hutterer2013-12-241-4/+4
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add more cross-referencesPeter Hutterer2013-12-242-14/+14
| | | | | | | doxygen doesn't detect enum cross-references automatically, prefix them with @ref Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* doc: remove initial * from example code linesPeter Hutterer2013-12-242-108/+108
| | | | | | doxygen actually copies that over into the resulting output. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Don't treat devices with (ABS_MT_SLOT - 1) as multitouch devicesPeter Hutterer2013-12-102-2/+16
| | | | | | | | | | | | | Some devices (PS3 sixaxis controller) merely have a bunch of axes, without the semantic information that linux/input.h requires. For those, the ABS_MT range may be merely another axis, not the special range that we need to treat it with. Use a simple heuristic: if ABS_MT_SLOT - 1 is enabled, don't treat ABS_MT as multitouch axes. The ABS_MT_SLOT - 1 axis is not used for a real axis. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Merge branch 'ev-rep-handling'Peter Hutterer2013-12-092-4/+21
|\
| * Support EV_REP values through libevdev_get_event_valuePeter Hutterer2013-12-092-2/+19
| | | | | | | | | | | | | | | | | | We shouldn't have a separate API for that, the whole point of libevdev is to abstract the quirkyness of the ioctls into a common interface. So let's export the two EV_REP values through libevdev_get_event_value. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
| * Constify libevdev_get_repeatPeter Hutterer2013-12-092-2/+2
| | | | | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* | State that the event is defined for a SYN_DROPPEDPeter Hutterer2013-12-091-3/+5
|/ | | | | | | | | | | | All clients that want to handle SYN_DROPPED correctly need to pass an EV_SYN through their own handlers before starting with the syn events. Rather than letting them synthesize that, guarantee that the event is defined the first time LIBEVDEV_READ_STATUS_SYNC is returned. This does not change existing behavior, it merely documents it so we can rely on it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Move the testing part to a separate pagePeter Hutterer2013-12-091-11/+13
| | | | | | Not something that interests the average visitor of the front page Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add a doxygen page listing the ioctls and their current supportPeter Hutterer2013-12-091-1/+63
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Documentation fix, refer to correct functionPeter Hutterer2013-12-051-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Fix a typo in the documentationPeter Hutterer2013-12-051-1/+1
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Drop some leftover deprecated constants.Peter Hutterer2013-11-281-6/+0
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Drop semicolons after getter/setter macrosPeter Hutterer2013-11-221-16/+16
| | | | | | | | libevdev.c:921:134: warning: ISO C does not allow extra ';' outside of a function [-Wpedantic] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Drop trailing comma from last element in the enumsPeter Hutterer2013-11-222-7/+6
| | | | | | | If a caller is compiled with -pedantic, this causes a few complaints Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Drop deprecated functionsPeter Hutterer2013-11-222-79/+0
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Review/update .gitignore filesGaetan Nadon2013-11-191-0/+1
| | | | | | | | | | | | | | | | Merge potentially useful patterns taken from other projects. Some application specific patterns were move to their respective directories. The only noticeable change is that *.patch is ignore to prevent accidental checkin of patches. The pattern "test-driver" could not be found and was removed. The test directory had not been updated since the move of all test cases in a single binary. Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Drop gcov flags from main libevdev sourcesPeter Hutterer2013-11-181-5/+1
| | | | | | | | We recompile the sources anyway in the tests and we have our own CFLAGS there. Drop them from the main library code so we don't leave gcov files everywhere. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Provide separate lookup functions for zero-terminated stringsPeter Hutterer2013-11-012-12/+58
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Add libevdev_event_type/code_from_name() resolversDavid Herrmann2013-10-313-0/+177
| | | | | | | | | | | | Three new helpers are added: (1) libevdev_event_type_from_name() takes a string describing an EV_* event type and returns the given event-type constant. (2) libevdev_event_code_from_name() takes a string describing an event code and returns the given event-code constant. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Create event type/code lookup tablesDavid Herrmann2013-10-311-4/+59
| | | | | | | | | | | | | Additionally to type->string mapping tables we now also create string->type lookup tables. The lookup tables are sorted by their name so binary-search will work. We create one lookup table for EV_* types and one for all event-codes. More tables (like bus-names, input-properties, ..) can be added later. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add startswith() helperDavid Herrmann2013-10-311-0/+8
| | | | | | | | | | Simple helper that use strncmp() to test whether a given string starts with a given suffix. While it doesn't reduce code-size by much, it is a lot more readable than the strncmp() usage. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Check max to see if an event type is validPeter Hutterer2013-10-241-2/+14
| | | | | | | | There's a gap in the range between EV_SW and EV_LED. Trying to enable one of those bits will segfault. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Make sure EV_SYN is always setPeter Hutterer2013-10-241-1/+2
| | | | | | | | Set the bit during device reset and make sure that if we're checking for the event type we always return true for EV_SYN. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Disallow disabling EV_SYN event codesPeter Hutterer2013-10-241-1/+1
| | | | | | | The documentation already says that, make it happen. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Reset the struct on set_fdPeter Hutterer2013-10-231-7/+19
| | | | | | | | | | | libevdev_set_fd may fail at a number of points. If it does, it errors out but does nothing otherwise. Thus, a client may call set_fd again for the same struct but on a different fd and have it succeed. Depending on when set_fd bailed out the first time, some fields may already be set. Thus, reset the whole struct at set_fd time to make sure we're nulled out appropriately. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Document backwards-compatibility behaviourPeter Hutterer2013-10-231-0/+56
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Work around missing EVIOCGMTSLOTS ioctlPeter Hutterer2013-10-231-2/+12
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Make uinput-code backwards-compatible to missing UI_SET_PROPBIT ioctlPeter Hutterer2013-10-231-1/+18
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* When running against a kernel without properties, continue as usualPeter Hutterer2013-10-231-1/+5
| | | | | | Missing out on properties is not fatal. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Pass linux/input.h as argument to make-event-names.pyPeter Hutterer2013-10-232-7/+6
| | | | | | Rather than a hardcoded path inside the source. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add a copy of linux/input.hPeter Hutterer2013-10-231-2/+3
| | | | | | | This avoids a number of otherwise required ifdefs when building on older kernels Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* configure: test for python and python-argparsePeter Hutterer2013-10-211-1/+1
| | | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
* Don't allow a negative fd in libevdev_set_fdPeter Hutterer2013-10-141-1/+2
| | | | | | Everything else responds with -EBADF, let's do so here as well. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Allow -1 as valid fd in libevdev_change_fdPeter Hutterer2013-10-142-14/+25
| | | | | | | | | | | Add a new flag for "initialized" and separate that from the fd logic. This way, we can call libevdev_change_fd(dev, -1) to signal that the current fd should be dropped. Otherwise libevdev can't be told to release the fd and always keeps a reference to it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Uppercase #define LIBEVDEV_INT_HPeter Hutterer2013-10-081-2/+2
| | | | | | over-eager search/replace Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>