Age | Commit message (Collapse) | Author | Files | Lines |
|
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
|
|
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
|
|
So we know which kernel driver is handling the device. Quite useful,
sometimes, without having to ask for extra logs.
This of course requires that we ignore said property in libinput replay
since no uinput device will have that driver property set.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1007>
|
|
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/988>
|
|
Fix warnings about variables that should be made static when compiling
with Sparse enabled:
$ CC=cgcc meson builddir
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/987>
|
|
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/985>
|
|
Some tablets such as those in the XP-PEN PRO series use "dials" which
are actually scrollwheels and emit EV_REL events. These should not be
emulated as rings (which are absolute) so we must expose them as a new
tablet event.
Adds LIBINPUT_EVENT_TABLET_PAD_DIAL that work largely identical as our
high-resolution wheel events (i.e. the values are in multiples or
fractions of of 120). Currently supports two dials.
This is a lot of copy/paste from the ring axes because the interface is
virtually identical. The main difference is that dials give us a v120
value in the same manner as our scroll axes.
Notes:
- REL_DIAL is mutually exclusive with REL_WHEEL, we assume the kernel
doesn't (at this point) give us devices with both. If this changes for
devices with three dials (wheel + hwheel + dial) we need to add code
for that.
- REL_DIAL does not have a high-resolution axis and we assume that any
device with REL_WHEEL_HI_RES will also have REL_HWHEEL_HI_RES (if the
second wheel exists).
- With dials being REL_DIAL or REL_WHEEL there is no possibility of
detecting a finger release (the kernel does not route EV_RELs with a
value of zero). Unless this is implemented via a side-channel - and it
doesn't look like any hardware that supports dials does that - we
cannot forward any information here. So unlike absolute rings we
cannot provide a source information here.
Closes #600
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/967>
|
|
|
|
A follow up on commit 65eaabf91f58 ("tools/record: print the vid/pid
with proper 4 hex digits").
Print the bus name in addition to the bus ID. Only the busses available
in quirks are printed.
Example:
$ sudo libinput record
[...]
# ID: bus 0x0003 (usb) vendor 0x046d product 0x406d version 0x0111
[...]
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Fixes #931
|
|
The range is (max - min + 1) because the kernel range is inclusive min
and max. Let's fix that once and for all with a helper function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The field with includes the 0x if printing with "0x04d". And because
that format prints zero as just 0000, let's move the 0x prefix out and
let printf only handle the actual number.
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>
|
|
Simplifies things a bit since it makes it all more explicit
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>
|
|
openrazer keeps a convenient list of keyboard devices that belong to the
RazerBlade line and thus should be marked as internal by us. Let's
use that one.
This script git clones the current openrazer repo, imports the file we
need and then overwrites our current quirks file with the sorted list of
devices.
For the second part of this to work reliable we need a marker in the
quirks file that marks the start of autogenerated entries.
Heavily influenced by @danryu in !887.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Adds a dedicated scroll movement type to the custom acceleration profile.
Supported by physical mouse and touchpad.
Other profiles remain the same by using the same unaccelerated filter for the scroll filter.
Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
|
|
For the cases where it's not possible to hit enter to start the replay
because e.g. we cannot change focus, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The custom acceleration profile allow the user to define custom
acceleration functions for each movement type per device, giving
full control over accelerations behavior at different speeds.
This commit introduces 2 movement types which corresponds to the
2 profiles currently in use by libinput.
regular filter is Motion type.
constant filter is Fallback type.
This allows possible expansion of new movement types for the
different devices.
The custom pointer acceleration profile gives the user full control over the
acceleration behavior at different speeds.
The user needs to provide a custom acceleration function f(x) where
the x-axis is the device speed and the y-axis is the pointer speed.
The user should take into account the native device dpi and screen dpi in
order to achieve the desired behavior/feel of the acceleration.
The custom acceleration function is defined using n points which are spaced
uniformly along the x-axis, starting from 0 and continuing in constant steps.
There by the points defining the custom function are:
(0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1])
where f is a list of n unitless values defining the acceleration
factor for each velocity.
When a velocity value does not lie exactly on those points, a linear
interpolation of the two closest points will be calculated.
When a velocity value is greater than the max point defined, a linear
extrapolation of the two biggest points will be calculated.
Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Fixes e.g. the case where debug-events is used to get the initial device
list but no more. Since we never flush, the content is stuck in the
buffers and gets lost.
Easy way to reproduce: `libinput debug-events | cat`, then ctrl+c and see
nothing show up (before this patch, anyway).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
When libinput-record fails to parse the quirks, it suggest to use the
--verbose flag to get more details. However, libinput-record does not
support the --verbose flag.
Replace the error message and add a link to the documentation instead.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Lists all SUBSYSTEM=hid devices, including the respective hidraw and
evdev nodes.
Note that this takes a shortcut in the udev handling: in theory we
*should* compare the hidraw/evdev parent device with our hid device. In
practice, checking if the devpath starts with the same substring is good
enough.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Same as libinput list-devices, but lists the available event nodes. This
effectively does the same as libinput record without arguments but it's
more obvious in what it is supposed to do and thus easier to point to.
Also, it uses pyudev instead of libevdev so it does not need to run as
root to discover devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This switches the quirk from AttrEventCodeEnable/Disable to just
AttrEventCode with a +/- prefix for each entry.
This switches the quirk from AttrInputPropEnable/Disable to just
AttrInputProp with a +/- prefix for each entry.
Previously, both event codes and input props would only apply the
last-matching section entry for a device. Furthermore, an earlier Disable entry
would take precedence over a later Enable entry. For example, a set of
sections with these lines *should* enable left, right and middle:
[first]
AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;BTN_MIDDLE
[second]
AttrEventCodeDisable=BTN_RIGHT
[third]
AttrEventCodeEnable=BTN_LEFT;BTN_RIGHT;
Alas: the first line was effectively ignored (quirks only returned the
last-matching one, i.e. the one from "third"). And due to implementation
details in evdev.c, the Disable attribute was processed after Enable,
i.e. the device was enabled for left + right and then disabled for
right. As a result, the device only had BTN_LEFT enabled.
Fix this by changing the attribute to carry both enable/disable
information and merging the commands together.
Internally, all quirks matching a device are simply ref'd into an array
in the struct quirks. The applied value is simply the last entry in the
array corresponding to our quirk.
For AttrEventCode and AttrInputProp instead do this:
- switch them to a tuple with the code as first entry and a boolean
enable/disable as second entry
- if the struct quirk already has an entry for either, append the more
recent one to the existing entry (instead of creating a new entry in
the array). This way we have all entries that match and in-order of
precedence - i.e. we can process them left-to-right to end up
with the right state.
Fixes: https://gitlab.freedesktop.org/libinput/libinput/-/issues/821
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
We only touch src and tools, imported headers from include are not ours
to change.
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>
|
|
When compiling with Sparse enabled:
$ CC=cgcc meson builddir
Fix warnings about variables that should be made static.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
On Sway, and probably other Wayland compositors based on wlroots, the
window_lock_pointer() was called twice.
Avoid errors when window_lock_pointer() is invoked multiple times.
Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/808
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Some distributions, like Fedora, compile libinput with the debug-gui
option set to false.
Running "libinput debug-gui" indicates that the program is not
installed; however, the help message suggests that the command is
available.
Hide debug-gui from the help message when it is not included.
Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/480
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Fixes 1f1ddbc6dff0cf0451e3c9ac923f9821278560aa
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
We have two different dependencies on Wayland: GTK support and the
wayland-protocols we use directly. If we have GTK support but
wayland-protocols is not installed at meson configure time, our build
fails.
To avoid having multiple ifdefs in the code, let's define two new ones:
HAVE_GTK_WAYLAND and HAVE_GTK_X11, both set if GTK supports that
particular target (from pkgconfig) and we have the other support
libraries we need.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
This tests a bunch of internal utility functions that may work
differently depending on compiler flags, etc. Let's make that test
available so it can be verified on an installed system.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
We already install libinput-test-suite if the meson option install-tests
is set, see
commit be7045cdc70d8c026d981997852cc706dab3d5b8
test: make the test suite runner available as installed binary
To make other tests easily available and more discoverable, add a new
tool "libinput test" with the matching man page. This will also help us
to enforce some of the namespacing a bit better.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
When redirecting to a file, we don't want lines like this:
.. +2 ... +5 ... +9
Let's not print anything until we have collected all those lines and
then print the final result, we don't need a live update here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Helpful in comparing values that update frequently - without this the
last printed value may be way off the page when some other value comes
in that it needs to be compared to.
Values not seen yet default to zero - we can't query those from a
recording but it'll be good enough this way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Commit 0cdf459643bfa6264bd2d1af8f7749529ebffee1
tools/record: get rid of indent push/pop, replace with fixed indents
Introduced some magic to detect if there's a '-' at the start of the
format string to fix the identation. This only works if the format
string is constant though, leading to an indentation error when record
is run with --with-libinput.
Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Otherwise redirecting the output to a file leaves us with ugly ^M
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Use --ignore ABS_X,ABS_Y or --only ABS_X,ABS_Y to ignore or limit to
only a specific axis set. Especially for tablet devices with their
multitudes of axes this makes analysing a particular set easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Fixes 0cdf459643bfa6264bd2d1af8f7749529ebffee1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
All cases we have in our code base have an otherwise unused variable to
loop through the array. Let's auto-declare this as part of the loop.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Add option to control whether the touchpad should be disabled while the
trackpoint is in use.
Fix #731
Signed-off-by: pudiva chip líquida <pudiva@skylittlesystem.org>
|
|
When a boolean quirk was displayed its real value was ignored and
instead a hardcoded value of 1 was always used.
Get the quirk real value and display it.
Fix #725
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Translates to the same thing, but the bit() helper is nicer and less
likely to be typoed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Starting with kernel v5.0 two new axes are available for high-resolution wheel
scrolling: REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES. Both axes send data in
fractions of 120 where each multiple of 120 amounts to one logical scroll
event. Fractions of 120 indicate a wheel movement less than one detent.
This commit adds a new API for scroll events. Three new event types that encode
the axis source in the event type name and a new API to get a normalized-to-120
value that also used by Windows and the kernel (each multiple of 120 represents
a logical scroll click).
This addresses a main shortcoming with the existing API - it was unreliable to
calculate the click angle based on the axis value+discrete events and thus any
caller using the axis value alone would be left with some ambiguity. With the
v120 API it's now possible to (usually) calculate the click angle, but more
importantly it provides the simplest hw-independent way of scrolling by a
click or a fraction of a click.
A new event type is required, the only way to integrate the v120 value
otherwise was to start sending events with a discrete value of 0. This
would break existing xf86-input-libinput (divide by zero, fixed in 0.28.2) and
weston (general confusion). mutter, kwin are unaffected.
With the new API, the old POINTER_AXIS event are deprecated - callers should use
the new API where available and discard any POINTER_AXIS events.
Notable: REL_WHEEL/REL_HWHEEL are emulated by the kernel but there's no
guarantee that they'll come every accumulated 120 values, e.g. Logitech mice
often send events that don't add up to 120 per detent.
We use the kernel's wheel click emulation instead of doing our own.
libinput guarantees high-resolution events even on pre-5.0 kernels.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|