diff mbox

[5/5] hid: ntrig: Mask pen switch events

Message ID 1289549514-5421-6-git-send-email-rydberg@euromail.se
State Accepted
Delegated to: Andy Whitcroft
Headers show

Commit Message

Henrik Rydberg Nov. 12, 2010, 8:11 a.m. UTC
From: Henrik Rydberg <rydberg@bitmath.org>

When the pen comes in proximity, special packets appear on the
multitouch device. This confuses userland to misinterpret the
touch state. This patch masks the special pen packets consisting
of a single finger of width 10, thereby fixing the problem.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/hid/hid-ntrig.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index 05f7e27..0fcd499 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -369,6 +369,10 @@  static int ntrig_event (struct hid_device *hid, struct hid_field *field,
 				break;
 			nd->nindex = 0;
 			nd->ncol = value;
+			/* skip pen switch events */
+			if (nd->ncol == 1 &&
+			    nd->col[0].w == 10 && nd->col[0].h == 10)
+				break;
 			report_frame(input, nd);
 			break;
 		}