| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
For a device used upside-down, make sure the wheels correspond to the
new physical directions. There's a grace range of 20 degrees either way
since that seems like it makes sense.
For 90 degree rotation (or 270 degree) the wheel is left as-is, the
heuristics to guess what angle we want in this case is not clear enough.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
Some touchpads, notably those on the Dell XPS 15 9500, are prone to registering
touchpad clicks when the case is sufficiently flexed. Ignore these by
disregarding any clicks that are registered without touchpad touch.
Signed-off-by: Rob Glossop <robgssp@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This hurts more than it helps, and users complain of dead trackpad
edges. Apple touchpads have fairly sophisticated internal palm rejection
algorithms going back many years, so let's just disable this one on
everything Apple.
Related to: #433 (need to figure out what other hardware may need this)
Signed-off-by: Hector Martin <marcan@marcan.st>
|
|
|
|
|
|
| |
As suggested by the comment itself. I think most users expect this.
Signed-off-by: Hector Martin <marcan@marcan.st>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now for touch arbitration to work, we require the device group to
be the same (i.e. they're hanging off the same physical bus). That's not
always the case and statistically we have a lot more devices that have
a built-in tablet + touchscreen than we have Intuos-like external
tablets.
So let's default to the more common case - enabling arbitration with the
first touchscreen/external touchpad we find. If a subsequent device is
"better", swap it out. Right now, the only heuristic we have here is the
device group check but in the future we could get more precise.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The key_count array for buttons records the logical button sent to the
client - for left-handed configurations that means a BTN_LEFT is
recorded as BTN_RIGHT.
When the device is suspended and we are releasing all keys we must thus
release the button code as-is without trying to map it again.
Fixes #881
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
| |
Like in libinput_device_switch_has_switch()'s documentation, document
the error case in libinput_device_tablet_pad_get_num_buttons(),
libinput_device_tablet_pad_get_num_rings() and
libinput_device_tablet_pad_get_num_strips().
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was added in 39f11253471500cd380c8977b8cbe0683abe6b1d
(https://bugs.freedesktop.org/show_bug.cgi?id=89625)
Later, a more sophisticated palm detection was implemented in
46eab97538af18381243f5337bf3d29e4b21098f
(https://bugs.freedesktop.org/show_bug.cgi?id=103210)
The only place where `tp_palm_tap_is_palm()` is called is if the more
sophisticated palm detection has already decided that this is not a palm,
so it should never return true.
Signed-off-by: Tobias Bengfort <tobias.bengfort@posteo.de>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
The `speed_factor()` formula is unnecessarily complex, The behavior that is described in the comment can be achieved with a simple power function.
And adjust the comment to explicitly state that 0.05 is the minimum.
|
|
|
|
|
|
|
| |
Rectangle-based touch arbitration should respect calibration. This
fixes #853.
Signed-off-by: hrdl <git@hrdl.eu>
|
|
|
|
|
|
|
| |
Previously the arbitration rectangle would be moved to lie completely in
the first quadrant of the coordinate system.
Signed-off-by: hrdl <51402-hrdl@users.noreply.gitlab.freedesktop.org>
|
|
|
|
|
|
|
| |
Adds min and max size limit for custom acceleration function's points.
Adds tests to make sure validation works properly.
Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike in traditional touchpads, whose pressure value equals contact
size, on pressure pads pressure is a real physical axis.
We don't take advantage of the pressure information reported by
pressure pads yet, so we disable it to avoid errors.
Add a new model quirk for pressure pads instead of disabling
ABS_MT_PRESSURE and ABS_PRESSURE.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we restricted rotation to trackballs only and to multiples
of 90 degrees. Update rotation allow angles other than multiples of 90.
Also enable rotation on all mice. The only devices without rotation
are now pointing sticks.
Fixes #827
Signed-off-by: Lucas Zampieri <lzampier@redhat.com>
|
|
|
|
|
|
|
|
| |
Check the tag before we read any multiplier quirks. And don't bother
reading the DPI for trackpoints either because it doesn't make sense for
those 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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
A user was experiencing issues with their hand being recognized as
touch input above the stylus tip.
Since touch above the stylus should be rare, increase the touch
arbitration rectangle height by 50mm.
Fix: https://gitlab.freedesktop.org/libinput/libinput/-/issues/809
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the warning generated:
[82/243] Compiling C object libinput.so.10.13.0.p/src_evdev-tablet.c.o
../src/evdev-tablet.c:938:1: warning: unused function
'tool_set_bits_from_libwacom' [-Wunused-function]
tool_set_bits_from_libwacom(const struct tablet_dispatch *tablet,
^
When building with Clang v15 and without libwacom:
$ CC=clang CXX=clang++ meson builddir -Dlibwacom=false
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the warnings generated:
../src/evdev-tablet-pad-leds.c:54:1: warning: unused function
'pad_mode_toggle_button_new' [-Wunused-function]
pad_mode_toggle_button_new(struct pad_dispatch *pad,
^
../src/evdev-tablet-pad-leds.c:194:1: warning: unused function
'pad_group_new' [-Wunused-function]
pad_group_new(struct pad_dispatch *pad,
^
../src/evdev-tablet-pad-leds.c:238:1: warning: unused function
'pad_led_get_sysfs_base_path' [-Wunused-function]
pad_led_get_sysfs_base_path(struct evdev_device *device,
^
When building with Clang v15 and without libwacom:
$ CC=clang CXX=clang++ meson builddir -Dlibwacom=false
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The escape key can be used to cancel a drag and drop action in some
desktop environments. However, it triggers disable-while-typing, ending
the drag and drop action rather than cancelling it.
Add it to the tp_key_ignore_for_dwt() set to avoid it.
Since I'm here, add the asterisk key as it is the only numpad key not
ignored by tp_key_ignore_for_dwt().
Fix: https://gitlab.freedesktop.org/libinput/libinput/-/issues/820 # [1]
Suggested-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
| |
Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 806d4a1393db ("tablet: check libevdev_get_abs_info() return
value") prevented a crash when tilt was deactivated by a quirk.
For more information check [1].
Add similar checks before calling libevdev_get_abs_info() to avoid
possible crashes.
[1] https://gitlab.freedesktop.org/libinput/libinput/-/issues/805
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit b5f0536a4f93 ("quirks: add a quirk for the Wacom 524c device")
added the quirk "AttrEventCodeDisable=ABS_TILT_X;ABS_TILT_Y;" to the
Wacom 524c.
When using the pen in a display with tilt support, the tilt X/Y axes
are set as changed. Using the pen again, but this time in the display
without tilt support, will try to get the tilt information, crashing.
Check the return value of libevdev_get_abs_info() to avoid this crash.
Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/805
Fixes: b5f0536a4f93 ("quirks: add a quirk for the Wacom 524c device")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, trackpoints got assigned the normal flat profile which does not
accommodate for the trackpoint magic multiplier *and* had a config range
that was too small if you take the multiplire indo account anyway.
Fix this by adding a trackpoint-specific flat accel that has a wider
configuration range and take sthe magic multiplier into account.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Users that want a flat pointer acceleration want the input speed to
match 1:1 to the output speed, barring a fixed constant multiplier.
This will apply to things like button scrolling as well, so let's map
the constant accel function to the non-constant accel functions to the
speed setting applies to every movement.
This is applied to both the flat and the touchpad flat filter.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
| |
The first thing this filter does is normalize the coordinates to
1000dpi, i.e. all other values are in normalized coordinates.
By normalizing the speed again we get an invalid value, effectively
stretching or compressing the acceleration curve. e.g. on a 5000dpi
mouse the estimated speed was 1/5 of the real speed.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
Rather than normalizing manually, leave this up to the pointer acceleration
code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our pointer filter code has two functions - one for accelerated movement
and one for "constant" movement (i.e. no accel factor provided but same
conversions). Let's use that instead of a manual normalization.
This fixes an issue with button scrolling on high-dpi mice in the flat
pointer acceleration: normal pointer motion in the flat profile isn't
normalized but the button scrolling was - resulting in e.g. 5 times
slower motion for button scrolling on a 5000dpi mouse.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The filter vs const filter is supposed to be for accelerated vs
non-accelerated motion (e.g. pointer motion vs scrolling) - in both
cases the returned value is supposed to be in the same coordinate
system, just once with an extra accel factor applied.
This was broken in the flat and low-dpi profiles: in both of those the
accelerated filter does *not* normalize, it merely applies the fixed/adaptive factor.
The constant filter normalized however. The result was that on e.g. a
5000dpi mouse the constant motion was 5 times slower than the
accelerated motion, even with a factor of 1.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional change
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
This is no longer trackpoint-only, so let's rename this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
No functional changes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a leftover from when some of the filter code was shared between
pointer acceleration methods (pre v1.11 or so). Now these functions are
duplicated across files, so both the names and what they do isn't
necessarily reflective anymore.
Let's drop one layer of indirection to make the code a bit easier to
understand.
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
No functional changes, this is just for improving readability and a
leftover when some of these functions were used by multiple filters.
This filter normalizes the data first, then applies the acceleration to
the normalized values. So let's keep the data in normalized_coords
structs and only drop to device_float_coords when we have to to use the
tracker API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
We log this a few lines south of here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The IBM/Lenovo Scrollpoint mouse features a trackpoint-like stick that
sends a great amount of scroll deltas.
In order to handle the device, a quirk is in place to normalize the
scroll events as they were relative motion.
However, when high-resolution scroll was implemented, we started
normalizing the hi-res events instead of the lo-res events by mistake.
Fix the quirk by normalizing the right deltas.
Fixes: 6bb02aaf307a ("High-resolution scroll wheel support")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Tested-by: Peter Ganzhorn <peter.ganzhorn@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On mice, switching the acceleration profile to flat disables dpi normalization,
because high or even switchable dpi are generally major features of a
high-end mouse, and switching to flat acceleration indicates that the user
wants to reduce the effects of any cursor acceleration to a minimum.
Therefore we skip normalization there and let the user take full advantage
of their expensive hardware.
On touchpads, particularly those built into a laptop, users have to deal with
whatever hardware they have; touchpad dpi is an afterthought at best, or
a disaster at worst. Switching to the flat profile is more likely to be
about avoiding the non-linear acceleration curve of the adaptive profile.
Hence the flat profile for touchpads shouldn't copy what the one for mice does,
but rather use dpi normalization like the adaptive profile. This keeps flat
acceleration on low-resolution touchpads from dropping to unusably slow speeds.
Signed-off-by: satrmb <10471-satrmb@users.noreply.gitlab.freedesktop.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tools default to 1% lower threshold (tip up) and 5% upper threshold (tip
down). But our distance vs pressure exclusion would reset the distance
for *any* pressure value, regardless how low that value was and how high
distance was in comparison.
A very low pressure value of less than 1% would then result in a
normalized pressure of 0, so we'd effectively just reset the distance to
zero and do nothing with the pressure. This can cause distance jumps
when the tool arbitrarily sends low pressure values while hovering as
seen in https://github.com/libsdl-org/SDL/pull/5481#issuecomment-1118969064
Commit 61bdc05fb0f84303f97daaba6ae6b49c976dbfbf from Dec 2017
"tablet: set the tip-up pressure threshold to 1%"
was presumably to address this but no longer (?) works.
Fix this by addressing multiple issues at the same time:
- anything under that 1% threshold is now considered as zero pressure
and any distance value is kept as-is. Once pressure reaches 1%,
distance is always zero.
- axis normalization is now from 1% to 100% (previously: upper threshold
to 100%). So a tip down event should always have ~4% pressure and we
may get tablet motion events with nonzero pressure before the tip down
event.
From memory, this was always intended anyway since a tip event should
require some significant pressure, maybe too high compared to e.g.
pressure-sensitive painting
- where a tablet has an offset, add the same 1%/5% thresholds, on top of
that offset. And keep adjusting those thresholds as we change the
offset. Assuming that the offset is the absolute minimum a worn-out
pen can reach, this gives us the same behaviour as a new pen. The
calculation here uses a simple approach so the actual range is
slightly larger than 5% but it'll do.
Previously, the lower threshold for an offset pen was the axis minimum
but that can never be reached. So there was probably an undiscovered
bug in there.
And fix a bunch of comments that were either wrong, confusing or
incomplete, e.g. the pressure thresholds were already in device
coordinates.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|