This allows the "Disable while typing" feature to work properly for:
048d:c102 Integrated Technology Express, Inc. ITE Device(8910)
This keyboard was found in the following Lenovo laptops:
* Legion 5 Pro 16ARH7H
* Legion 5 15ARH7H
The quirk for 16ARH7H was added in 94c785a2 (see #933), however
matching by DMI does not work for 15ARH7H, so let's match by
USB VID/PID instead.
https://gitlab.freedesktop.org/libinput/libinput/-/issues/933#note_2099049
This device has a touchpad with uncommon pressure sensitivity which
makes it hard to use out of the box.
Signed-off-by: Brady Norander <bradyn127@protonmail.com>
We need to set the `native` flag:
meson.build:704: WARNING: add_languages is missing native:,
assuming languages are wanted for both host and build.
As documented [1]:
If set to true, the language will be used to compile for the build
machine, if false, for the host machine.
[1] https://mesonbuild.com/Reference-manual_functions.html#add_languages
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
The meson version was `>= 0.49.0` but features from `0.56.0` were used:
meson.build:485: WARNING: Project targets '>= 0.49.0' but uses
feature introduced in '0.56.0': meson.project_source_root.
Update meson's target version to reflect the features used.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Meson recommends using the `meson setup [options]` command:
WARNING: Running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.
Update the documentation and CI to use the recommended command.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
The new pre-commit hook introduced in commit 53517dccb8 ("Add
pre-commit hooks") found 2 files ending with a double empty line:
Fix End of Files.............................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fix this error.
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
A follow up on commit 65eaabf91f ("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>
This ensures a few things are correct before we commit and/or push,
making life a bit easier for both our contributors and our maintainers
since some things should no longer end up in the MRs.
Activate via:
$ pre-commit install
$ pre-commit install --hook-type pre-push
The latter is required for the ci-templates hooks which are pre-push
only.
Due to a patch pushed accidentally to main, the `key_count` variable is
uninitialized in the `evdev_log_bug_libinput` code path:
../src/evdev.c:148:12: error: ‘key_count’ may be used uninitialized [-Werror=maybe-uninitialized]
148 | if (key_count > 32) {
| ^
../src/evdev.c: In function ‘evdev_pointer_post_button’:
../src/evdev.c:132:13: note: ‘key_count’ was declared here
132 | int key_count;
| ^~~~~~~~~
Fixes commit bb1e4a493f ("evdev: Log bug when releasing key with count 0")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
libinput keeps an internal key count. It is increased by 1 when the key
is pressed and decreased by one when the key is released.
The count should never be negative, however a user found an issue while
running Sway and hit an assert.
Replace the assert with a log to avoid the crash.
Fix https://gitlab.freedesktop.org/libinput/libinput/-/issues/928
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Google Chromebook Redrix (HP Elite Dragonfly) is shipped with a touchpad
from ELAN (ELAN2703:00 04F3:323B) with uncommon pressure parameters
which make moving and tapping not working out of box.
Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
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>
We must disable ABS_DISTANCE or else the automatic pressure offset
calculation doesn't work for this device.
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
detect_pressure_offset() currently rejects offsets that are greater than
20%. My graphics tablet (Wacom Bamboo Fun) is about 30%. The pen tip is
2 mm. Wacom recommends replacing at 1 mm, which means this isn't worn
out yet and we should instead increase the limit to make these devices
usable.
Without this change a "pen down" event happens simultaneously with the
pen being detected -- about 1 cm above the surface -- and producing
libinput pressure of about 0.30. This means you start drawing "in the
air", without knowing up front where the cursor is going to be.
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
- Explain calculation made by the driver.
- Provide detailed example with a plot for a custom function.
- Fix inaccurate explanation of unit values.
Signed-off-by: Yinon Burgansky <yinonburgansky@gmail.com>
Disable while typing is not working because the keyboard uses the USB
bus.
Add the `AttrKeyboardIntegration=internal` quirk to fix it.
Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/911
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
The HP stream x360's embedded-controller filters out events form its
builtin keyboard when in tablet-mode itself; and it has a volume up/down
on the side.
Do not suspend the keyboard when in tablet-mode so that the volume
up/down button keeps working when in tablet-mode.
Add a ModelTabletModeNoSuspend quirk so that the home button keeps
working when in tablet-mode.
This can safely be done since the rest of the keyboard gets disabled by
the embedded-controller for us.
Fixes https://gitlab.freedesktop.org/libinput/libinput/-/issues/920
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
We've had this for roughly 10y now and it's value is dubious. Most of
xorg no longer requires, mesa accepts but doesn't require it, most of GNOME
doesn't accept it and neither does systemd.
Let's drop the requirement.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Sprinkle a few asserts into the various string helpers for where our
arguments must not be NULL.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If a key is still down when the tablet mode switch goes on, make sure we
release the key before the switch goes in effect.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is a bit nitpicky but let's call the current quirks merely
"available" rather than "supported" since quirks should never be seen as
supported API.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Previously we only applied pressure offset handling for tablets that
supported ABS_DISTANCE. Detecting a pressure offset when the tool
doesn't actually touch the surface is easy after all.
But tablets without distance handling may also have a pressure offset,
so let's try to detect this. This is obviously harder since the pen will
always touch the tablet's surface whenever it is in proximity and thus
will always have *some* pressure applied to it.
The process here is to merely observe the minimum pressure value during
the first two strokes of the pen. On the third prox in, that minimum
pressure value is taken as the offset. If the pressure drops below the
offset, the offset is adjusted downwards [1] so over time we'll
get closer to the pen's real offset.
[1] this is already done for distance tablets too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
detect_pressure_offset() would previously update an existing offset but
otherwise skip most of the work for any event other than proximity-in
events. This was too hidden, let's split this into two functions - one
to update an existing offset and another one to detect a new offset.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Summary: we expect add, change or remove but kernel 4.12 added bind and
unbind. These events were previously discarded by udevd. Our rules should
handle any event *but* remove, so update as suggested in the announce email
linked below.
For a longer explanation, see the system 247rc2 announcement
https://lists.freedesktop.org/archives/systemd-devel/2020-November/045570.ht
See cd37dcfa66 where we did this already
for the udev rules we use ourselves.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ensure that if we do get pressure < offset that that offset is reduced
to the current pressure value.
The implementation for this is arguably buggy, reducing the pressure
means we get a tip up event since we now reach 0% of pressure. Arguably
we should enforce the tip staying down and releasing it later but since
this should typically never happen more than once per tool per context
and working around this is a lot of effort, we live with it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Makes the code a bit easier to read. Adds precision to some tests,
slightly loosens precision in some other tests but that shouldn't matter
here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is way too hidden to the point where i couldn't find it for quite a
while despite knowing it exists. Move it to an entry under
troubleshooting.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This was never intended as a true real name policy (and we never
actually interpreted it that way), its purpose is to identify users
and avoid commits from 12345@example.com.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Swap any input for both x/y and default to a calibration matrix that
swaps it back. In theory, that device will then behave as every other
device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
All other motion/touch/... coords are already doubles so let's follow
suite here. And passing a pointer into the custom handlers
means we can modify x/y slightly and return false, leaving the rest up
to the generic event handling code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>