diff mbox

[7/7] elantech: average the two coordinates when 2 fingers

Message ID 4C1FD454.4050807@tudelft.nl (mailing list archive)
State New, archived
Headers show

Commit Message

Éric Piel June 21, 2010, 9:06 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index c84f741..d1b505a 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -301,11 +301,11 @@  static void elantech_report_absolute_v2(struct psmouse *psmouse)
 		/* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */
 		y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]);
 		/*
-		 * For compatibility with the X Synaptics driver scale up
-		 * one coordinate and report as ordinary mouse movent
+		 * For compatibility with non-multitouch userspace apps
+		 * report the average of both coordinates and scale up.
 		 */
-		input_report_abs(dev, ABS_X, x1 << 2);
-		input_report_abs(dev, ABS_Y, y1 << 2);
+		input_report_abs(dev, ABS_X, (x1 + x2) << 1);
+		input_report_abs(dev, ABS_Y, (y1 + y2) << 1);
 		/*
 		 * For compatibility with the proprietary X Elantech driver
 		 * report both coordinates as hat coordinates