Skip to contentSkip to conversation

HID: wacom: do not send pen events before touch is up/forced out

PATCH Applied Ping Cheng 2 participants 2 messages Feb 20, 2015 – Mar 5, 2015

Subsystems (2)
lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH 1/2 HID: wacom: do not send pen events before touch is up/forced out

If pen comes in proximity while touch is down, we force touch up before sending pen events. Otherwise, there can be unfinished touch events compete with pen events. This idea has been fully implemented for Tablet PCs. But other tablets that support both pen and touch are not fully considered.

---
 drivers/hid/wacom_wac.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/hid/wacom_wac.c +6 -0
index 046351c..69827c9 100644
@@ -554,6 +554,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 	if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
 		wacom->shared->stylus_in_proximity = true;
 
+	if (wacom->shared->touch_down)
+		return 1;
+
 	/* in Range while exiting */
 	if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) {
 		input_report_key(input, BTN_TOUCH, 0);
@@ -1759,6 +1762,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
 		return 0;
 	}
 
+	if (wacom->shared->touch_down)
+		return 0;
+
 	prox = (data[1] & 0x20) == 0x20;
 
 	/*
Signature · 1 line
1.9.1
Acked-by on v1 1/2
#1 lore raw
Quoted 7 lines · Ping Cheng

If pen comes in proximity while touch is down, we force touch up before sending pen events. Otherwise, there can be unfinished touch events compete with pen events. This idea has been fully implemented for Tablet PCs. But other tablets that support both pen and touch are not fully considered.

Signature · 7 lines
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
Quoted 20 lines
---
  drivers/hid/wacom_wac.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/hid/wacom_wac.c +3 -0
index 046351c..69827c9 100644
@@ -554,6 +554,9 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
  	if (features->quirks & WACOM_QUIRK_MULTI_INPUT)
  		wacom->shared->stylus_in_proximity = true;
 
+	if (wacom->shared->touch_down)
+		return 1;
+
  	/* in Range while exiting */
  	if (((data[1] & 0xfe) == 0x20) && wacom->reporting_data) {
  		input_report_key(input, BTN_TOUCH, 0);

drivers/hid/wacom_wac.c static int wacom_bpt_pen(struct wacom_wac *wacom) · line 1770

Quoted 9 lines
drivers/hid/wacom_wac.c +3 -0
@@ -1759,6 +1762,9 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
  		return 0;
  	}
 
+	if (wacom->shared->touch_down)
+		return 0;
+
  	prox = (data[1] & 0x20) == 0x20;
 
  	/*

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