| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise, the distribution tarballs will be generated based on what's
in libevdev_la_SOURCES, which only includes the headers for the
operating system the maintainer happens to be running "make dist"
from. As a result of this, e.g. the 1.13.0 tarball only includes the
headers for Linux, making the tarball unbuildable for FreeBSD.
"meson dist" was already doing the right thing.
Signed-off-by: Alyssa Ross <hi@alyssa.is>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
With the 64 bit timestamps, the struct layout changes into a flatter
version, so let's use the input_event_(u)sec helpers to transparently
handle this.
Fixes #25
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
[1/16] Compiling C object libevdev.so.2.3.0.p/libevdev_libevdev.c.o
../libevdev/libevdev.c:665:40: warning: argument 2 of type ‘struct slot_change_state[dev->num_slots]’ declared as a variable length array [-Wvla-parameter]
665 | struct slot_change_state changes_out[dev->num_slots])
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libevdev/libevdev.c:47:52: note: previously declared as a pointer ‘struct slot_change_state *’
47 | struct slot_change_state *changes_out);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Remove an unnecessary and unmatched curly bracket from the demo code.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The example code for creating uinput devices produces the following
warnings:
warning: unused variable ‘ev’ [-Wunused-variable]
| struct input_event ev[2];
| ^~
warning: unused variable ‘new_fd’ [-Wunused-variable]
| int fd, new_fd, uifd;
| ^~~~~~
warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
| return err;
| ^~~
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
| |
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
|
|
|
|
| |
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
|
|
|
|
|
|
|
|
|
|
|
| |
The order of dict values is not deterministic in python leading to differing
header file generation which results in differing build output for the same
configuration. Sort to remove this inconsistency and make the output
reproducible.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Reviewed-by: Filipe Laíns <lains@archlinux.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to what must've been a copy/paste error many years ago, the license text
for libevdev wasn't actually the MIT license. Let's rectify this, it was
always MIT intended anyway.
To make this more obvious and reduce the chance of copy/paste mistakes, use
the SPDX license identifier in the various source files. The two installed
public header files have the full license text.
All contributors with copyrightable contributions have ACKed the license
change to MIT, either in the MR directly [1] or privately in reply to an
email.
[1] https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/69
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Alexander Dahl <ada@thorsis.com>
Acked-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Acked-by: Armin K <krejzi@email.com>
Acked-by: Benjamin Tissoires <btissoir@redhat.com>
Acked-by: David Herrmann <dh.herrmann@gmail.com>
Acked-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Emmanuele Bassi <ebassi@gnome.org>
Acked-by: Gaetan Nadon <memsize@videotron.ca>
Acked-by: George Thomas <georgefsthomas@gmail.com>
Acked-by: Michael Forney <mforney@mforney.org>
Acked-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Acked-by: Niclas Zeising <zeising@daemonic.se>
Acked-by: Owen W. Taylor <otaylor@fishsoup.net>
Acked-by: Peter Seiderer <ps.report@gmx.net>
Acked-by: Ran Benita <ran234@gmail.com>
Acked-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Scott Jann <sjann@knight-rider.org>
Acked-by: Thilo Schulz <thilo@tjps.eu>
Acked-by: polyphemus <rolfmorel@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Yes, the value we return is from the currently active slot, but there are a
few niche cases where the active slot changes from what the client may think
it is. So let's call it undefined like the other half of the documentation
already does.
Fixes #20
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
On some devices, a kernel input property has been set in error and we need the
ability to disable that property.
Signed-off-by: Scott Jann <sjann@knight-rider.org>
|
|
|
|
| |
Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
|
|
|
|
|
|
| |
Fixes fd6c9b8ca0ec0791c9aca11314bcb39f9c08555b
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Found with readability-else-after-return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
| |
Found with clang-tidy's llvm-include-order
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
| |
Found with clang-tidy's readability-inconsistent-declaration-parameter-name
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
|
|
|
|
|
| |
Document FreeBSD quirks related to syspath.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a FreeBSD version of fetch_syspath_and_devnode().
FreeBSD does not have sysfs, so instead fetch the device node directly
as as this matches with what is returned by the UI_GET_SYSNAME ioctl().
Since there is no sysfs, libevdev_uinput.syspath will always be set to NULL.
If the ioctl fail, return -1 from fetch_syspath_and_devnode(), since
there is no other way to figure out the device node path.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
|
|
|
|
|
|
| |
Move the definition of SYS_INPUT_DIR to where it is used, instead of at
the top of the file, to make it easier to find.
Undefine it at the end of usage to avoid accidental uses.
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add FreeBSD compatible input.h and uinput.h files.
This is done by moving the linux files to include/linux/linux, adding
the freebsd versions in include/linux/freebsd, and then changing
include/linux/[u]input.h to pull in the right one depending on which OS
we are compiling on.
Make sure that the build infrastructure in meson.build and
autoconf.ac/Makefile.am uses the correct files when building and as
dependency for targets, and ensure that make-event-names.py get the
correct files as arguments.
A similar change has been done in libinput in
61f3e3854458c556a01fb05d7abb22733fd2b7c1
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
|
|
|
|
|
|
| |
Fixes https://gitlab.freedesktop.org/libevdev/libevdev/-/issues/15
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: George Thomas <georgefsthomas@gmail.com>
|
|
|
|
|
|
| |
Where either block has braces, the other half should too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On a device with more than 256 slots we would read (and copy) past our changes
stack-allocated changes array. Fix this by capping to MAX_SLOTS though this
also requires us to memset the target where it is larger than MAX_SLOTS.
There are no real devices with 256+ slots, so this is a theoretical issue
only.
Fixes #11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
This cannot ever be unset on any real device, but coverity is unhappy and
that's not making me happy.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
| |
Clang doesn't support variable length arrays inside a struct so we could
either make our life complicated or just assume no-one is using more than 256
slots and hard-code that. Let's go for the easy solution until someone
notices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Where at least one touch ends during SYN_DROPPED, we send out two event
frames: one with all applicable touch sequences ending (tracking id -1) and
the second one with the whole device state *and* the applicable touch
sequences starting (tracking id != -1).
This requires us to also update the BTN_TOOL_ bits correctly so that they are
correct after the first frame. For that we count the number of previously
known touches and send a 0 event for the matching BTN_TOOL_ bit, together with
a 1 event for the currently known touches.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous event processing had subtle issues with touches stopping during
SYN_DROPPED. All of the device state was processed in the same frame, but if
any touch changed tracking ID during SYN_DROPPED, an inserted SYN_REPORT
resulted in a weird split of events:
- the first frame had all key/sw/abs updates including those slots that
changed tracking ID, but not the ones that were fully terminated.
- the second frame had only the slots states for newly started touches **and**
the slot state for touches terminated during SYN_DROPPED but not restarted.
In other words, where three fingers were on the touchpad and slot 0 was lifted
and put down again and slot 1 was lifted but *not* put down again, our frames
contained:
- frame 1: terminate slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1
- frame 2: start slot 0, terminate slot 1
Where there was no touch changing tracking ID, only one frame was generated.
The BTN_TOOL updates were buggy, they may not match the number of fingers down
as seen on a frame-by-frame basis. This triggered libinput bug
https://gitlab.freedesktop.org/libinput/libinput/issues/422
This patch changes the above example to
- frame 1: terminate slot 0, terminate slot 1
- frame 2: start slot 0, BTN_TOOL_TRIPLETAP 0, BTN_TOOL_DOUBLETAP 1
Notably, the first frame no longer contains the BTN_TOOL bits. This patch is
one of two, the BTN_TOOL sync bits are part of a follow-up patch.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Go from:
if (a != b)
continue;
foo;
to:
if (a == b) {
foo;
}
Basically just an indentation change after the condition inversion, makes the
follow-up patch easier to review.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the near future, we will need to handle slot termination *before* any other
state synchronization. So let's start splitting things up.
This is functionally equivalent though dropping the need_tracking_id_changes
variable means we run through all slots now to check if we need to terminate
one of them. Given the normal number of slots on a device and that this should
only ever run very rarely anyway... meh.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
Keep a better state of each touch before/after the SYN_DROPPED. Most of this
is currently unused, it's functionally the same as before but the new code
serves to increase readability and it can be passed around easier this way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional changes, just making the code slightly more compressed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
A few bytes get wasted, but no magic handling of offsets etc are required.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Much simpler code this way
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
| |
Replace it with a stack-allocated one. This saves us a bunch of confusing
allocations and size calculations.
And in the process use uint32_t/int32_t to ensure the struct is actually the
expected size.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
Mostly whitespace changes, two semicolon removals and one change to "foo is
None".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
It's well past time. If you need this to run on python2, patch it out locally.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|