[PATCH 3/3] Input: wacom - Send proper tablet state info when pen leaves proximity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The EMR sensor of Intuos4 and newer devices can send a packet with
0x20 in its second byte which contains only location information.
This packet is sent when the pen is too far away to reliably obtain
other information. Because only the location is updated userspace
will continue to see stale information for other values, most notably
TOUCH, PRESSURE, and DISTANCE.

This patch ensures userspace is not left with stale device state
information when the pen re-enters proximity (possibly leading to
the assumption the pen is still in contact even though it is
actually hovering).

Signed-off-by: Jason Gerecke <killertofu@xxxxxxxxx>
---
 drivers/input/tablet/wacom_wac.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 869e9c9..f67a75a 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -425,6 +425,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 			(features->type == WACOM_21UX2))
 		return 1;
 
+	/* Range Report */
+	if ((data[1] & 0xfe) == 0x20) {
+		input_report_key(input, BTN_TOUCH, 0);
+		input_report_abs(input, ABS_PRESSURE, 0);
+		input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max);
+	}
+
 	/* Exit report */
 	if ((data[1] & 0xfe) == 0x80) {
 		if (features->quirks == WACOM_QUIRK_MULTI_INPUT)
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux