diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-01 11:07:57 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-12-15 08:21:39 +1000 |
commit | db852ef0dbb61eb68d26affb3d01c194e0242369 (patch) | |
tree | ab6fd3e1da1e7c66ee8c77c8af708868146dac58 /src/libinput-private.h | |
parent | 09456ebf23b1ec9036bf22ebcecd19dcfef26615 (diff) |
tablet: support tool-specific pressure offsets
If a tool wears out, it may have a pre-loaded pressure offset. In that case,
even when the tool is not physically in contact with the tablet surface it
will send pressure events.
Use automatic pressure offset detection, similar to what the X.Org wacom
driver does. On proximity-in, check the pressure and if the distance is above
50% of the range and the pressure is nonzero but below 20% of the range, use
that value as pressure offset.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Diffstat (limited to 'src/libinput-private.h')
-rw-r--r-- | src/libinput-private.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libinput-private.h b/src/libinput-private.h index 38a14b8..f5b2648 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -259,6 +259,9 @@ struct libinput_tablet_tool { unsigned char buttons[NCHARS(KEY_MAX) + 1]; int refcount; void *user_data; + + int pressure_offset; + bool has_pressure_offset; }; struct libinput_event { |