tablet: increase pressure offset limit from 20% to 50%

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>
This commit is contained in:
Bjørn Forsman 2022-12-17 17:52:39 +01:00
parent f259cac9ca
commit 3dba00845c
3 changed files with 6 additions and 6 deletions

View file

@ -180,8 +180,8 @@ specifically:
capable of detection distances,
- pressure offset is only detected if the distance between the tool and the
tablet is high enough,
- pressure offset is only used if it is 20% or less of the pressure range
available to the tool. A pressure offset higher than 20% indicates either
- pressure offset is only used if it is 50% or less of the pressure range
available to the tool. A pressure offset higher than 50% indicates either
a misdetection or a tool that should be replaced, and
- if a pressure value less than the current pressure offset is seen, the
offset resets to that value.

View file

@ -1418,9 +1418,9 @@ detect_pressure_offset(struct tablet_dispatch *tablet,
if (offset <= pressure->minimum)
return;
if (offset > axis_range_percentage(pressure, 20)) {
if (offset > axis_range_percentage(pressure, 50)) {
evdev_log_error(device,
"Ignoring pressure offset greater than 20%% detected on tool %s (serial %#x). "
"Ignoring pressure offset greater than 50%% detected on tool %s (serial %#x). "
"See %s/tablet-support.html\n",
tablet_tool_type_to_string(tool->type),
tool->serial,

View file

@ -4115,7 +4115,7 @@ START_TEST(tablet_pressure_offset_exceed_threshold)
struct libinput *li = dev->libinput;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 70 },
{ ABS_PRESSURE, 30 },
{ ABS_PRESSURE, 60 },
{ -1, -1 },
};
int warning_triggered = 0;
@ -4137,7 +4137,7 @@ START_TEST(tablet_pressure_offset_exceed_threshold)
libinput_log_set_handler(li, pressure_threshold_warning);
litest_tablet_proximity_in(dev, 5, 100, axes);
libinput_dispatch(li);
assert_pressure(li, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, 0.30);
assert_pressure(li, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, 0.60);
ck_assert_int_eq(warning_triggered, 1);
litest_restore_log_handler(li);