This recovers the testing that a USB keyboard plus touchpad combo both
set as external, only its own keyboard should affect to DWT that was
removed when Acer Hawaii combo was set as internal.
This is uncommon as usb touchpads nowadays are set as internal, but,
perhaps someone that adds a quirk for a really external combo also adds
in udev's hwdb the external integration for the touchpad, or perhaps we
should set the integration to external when AttrTPKComboLayout=below is
used for the touchpad.
The issue is if the touchpad is leave as internal every keyboard affect
DWT, not only the one that belongs to its combo.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1415>
tablet_get_quirked_pressure_thresholds() is wrong:
the pressure thresholds for tip press and tip release are swapped around.
This seems to be a regression introduced in commit 4bc27543e9.
This prevents AttrPressureRange from working as intended for tablets,
and causes weird things to happen if it's set.
(For example, when pressure is in the range between
the intended release threshold and the intended press threshold,
the "pressed" status flip-flops between 0 and 1 every frame).
Fix that.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1420>
This adds a movement threshold (5mm) and a timeout (80ms) to the 3fg
drag gesture. On 3fg down with 3fg drag enabled we immediately send a
GESTURE_SWIPE event. After the timeout expires we check the movement of
the fingers - if it is below the threshold cancel the swipe and hold a
button down (i.e. a 3fg drag). Otherwise, continue with this being a
swipe.
This allows for swipe gestures to be used while 3fg drag is enabled.
Above applies the same way for 4fg with 4fg drag enabled.
Thresholds selected using the "yeah, that seems about alright" method,
intentionally quite low because we assume that users that enable 3fg
drag prefer 3fg dragging over swipe.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1410>
Instead of disabling the touchpad as soon as a mouse is seen by
libinput, disable it as soon as a mouse sends an actual event. This
works around the current issues with many devices (touchpads and
keyboards alike) announcing a HID Mouse Application Collection which
gets its own event node in the kernel. That event node usually just sits
there and does nothing but its mere presence disabled the touchpad.
Let's change this and instead only disable once we see an event.
Closes: #1104
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1414>
If a lua pcall takes longer than one second, kill the plugin.
How often to call the timeout handler is a trade-off but we err on the
side of "possibly too high" since the overwhelmingly vast majority of
plugins will never trigger it anyway.
Gemini suggests that Lua 5.4 can do ~500k ops per second for string
concat (the slowest listed), Claude suggests 1 to 10 million ops per
second. The test in this patch on my 4y old cheap desktop runs the
timeout hook roughly every 37ms. Any normal plugin will be well and
truly done with its work by then.
Closes: #1245
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1416>
This plugin controls a mouse/pointer from a tablet device. This
effectively hides stylus interactions and sends pointer events
instead. In other words: mouse emulation for tablets, implemented
by (remote) controlling a mouse device. This allows using a
tablet stylus as a mouse replacement without tablet limitations
from compositors or clients. Note that axis usually needed for
drawing (like pressure, tilt or distance) are no longer emitted
when this plugin is active and a mouse is connected. When no
mouse is connected, this plugin doesn't change tablet events,
thus the stylus works like a normal stylus.
Follow up from https://gitlab.freedesktop.org/libinput/libinput/-/issues/1195
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1412>
If the tool has a name let's provide that to the caller. We have it
easily accessible so let's export it to make everyone's life easier. The
name is provided by libwacom, there is no need for us
to even copy that value since we don't need it ourselves.
Note that at this point effectively only (some) Wacom devices have
meaningful names. Virtually all non-wacom devices will use a generic
tool and even the built-in Wacoms will largely just say "AES Pen".
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1399>
The WHEEL_STATE_NONE check was effectively always false:
- if we didn't receive any event yet, wheel_maybe_disable() wasn't
called in any code path
- if we did receive a scroll event, the wheel state was either
WHEEL_STATE_SCROLLING or WHEEL_STATE_ACCUMULATING_SCROLL
Fix this two-pronged: remove the check for WHEEL_STATE_NONE but also
immediately call disable when we disable the feature. We don't carry
enough state in this plugin to really worry about the device being in
a fully neutral state (and realistically the vast majority of use-cases
will likely disable wheel debouncing on new device anyway).
Closes#1241
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1408>
Actually not needed using internal approach.
Keyboard is ps2 wired in pogo pins and touchpad is usb, both internal by
default so dwt is in effect.
If tablet side buttons are also within ps2, they are not going to be
disabled as chassis is detachable.
Tablet mode switch untouched as is unclear if actual kernels play nice
with it.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1406>
Actually all usb touchpads are internal by default, reflect this in the
acer touchpad definition.
This causes that not only the acer keyboard in its group activates DWT
but all the intenal keyboards.
Remove asserting that other keyboards doesn't affect DWT as that is the
intended behaviour.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1400>
Ifdef out any special behavior we want so we no longer leak this via
strings in the resulting binary. Ideally we want the compile to fail for
anything missed rather than surprising behavior when we try to access
files in the build directory.
Closes: #1230
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1396>
These are quirks needed for Lenovo detachable devices by setting the
keyboard as internal to enable DWT and act as if it's a laptop.
Here we try to cover all the ideapad ones.
Also remove a quirk in Chicony that sets the touchpad below to enable
DWT, prefer to set the keyboard as internal as touchpad position is
intended for external ones like the input device we also move to the
bottom in Lenovo to have all pure input device quirks in one place.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1389>
This tests for a known bug in the implementation rather than the ideal case
how it should work.
The config is applied to the tool and on prox out to the current tablet
but then the tool goes in prox on a new tablet and the configuration
doesn't get applied there. In the test we work around this by injecting
an extra proximity event to get the range applied.
This needs some rework in the evdev-tablet code but it's questionable
whether it makes a difference given the small number of users with
multiple tablets and pressure ranges set.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1397>
Previously test devices had to set LITEST_AUTO_ASSIGN to be able
to override an axis-specific value. But this prevented us from
easily overriding other axis values (e.g. tablet tool ids) that usually
have the same value.
LITEST_AUTO_ASSIGN should indicate a value that must always be
auto-assigned, that makes a lot more sense.
This does mean we need to handle ABS_MT_TRACKING_ID -1 to avoid that
getting overwritten by auto_assign_tablet_value() but oh well.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
This only worked because any all our test devices declare a fixed 0
value for x/y in the proximity out event frame. Since 0 !=
LITEST_AUTO_ASSIGN we never got to the litest_scale() for x/y which
would abort because of the -1 value.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1398>
Cover Acer detachable keyboards used in Switch tablet devices to set
them internal and allow DWT.
Move one of them from chicony using the below method.
While at it change the match for internal keyboard in Acer Spin 5 to
rely of bus and type and add ':' before svn dmi match.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1392>
Don't disable inputs for detachable and tablet devices, they are
physically unplugged from their input devices but tend to have buttons
as internal keyboard in the tablet part that must work always. We know
what kind of device is using the Chassis Type DMI value.
Also remove specific device quirks now covered by the chassis type.
Finally refactor some Lenovo devices using this quirk and redefine Dell
2-in-1 with this quirk using chassis type.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1390>