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

Henrik Rydberg rydberg at euromail.se
Fri Nov 12 08:11:54 UTC 2010


From: Henrik Rydberg <rydberg at 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 at euromail.se>
---
 drivers/hid/hid-ntrig.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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;
 		}
-- 
1.7.1





More information about the kernel-team mailing list