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

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

 



On 21-07-10 05:36, Dmitry Torokhov wrote:
On Mon, Jun 21, 2010 at 11:06:28PM +0200, Éric Piel wrote:
When 2 fingers are pressed, the low and high coordinates are given.
Instead of reporting just the low coordinate as the normal position,
report an average of both. This allow to have the cursor always move,
whichever finger moves. In practice, this improves the support of
two-fingers scolling with the synaptics X driver.
:
-		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);

I am concerned what happens when you put one finger first and then add
another one. Would not that couse the cursor to jump?

I'd say we need to obey MT protocol and continue reporting the first
contact in non-MT protocol and rely on MT-aware drivers to do better job
of contact tracking. This is also consistent with how other drivers,
such as bcm5974, report coordinates.
If the MT protocol says we should always report on the single-touch side the first contact, then I guess it's better to do so. However, I've just read the latest version of the mt-protocol document, and couldn't see anything saying that. Are you sure this is the official behavior? I'd tend to think that single-touch and multi-touch are never read together, so they can be different.

More specifically, on this hardware, when there are two fingers, we get only the lower coordinates and the higher coordinates, but we don't know exactly where are the fingers. As there is no tracking, the lower coordinate might be the second finger applied, so even if we report just the lower coordinates, there is 75% chance that the cursor will jump.

That's actually the reason I prefer the average: it gives a 100% expectable behavior (because the average is always correct). In practice, when using the xorg synaptics driver, with the default 2-fingers-scrolling mode, the cursor never jumps because as soon as the second finger is applied, X and Y are not used to move the cursor.

So, I think this patch is an improvement for the user, but if you think that it would not respect the MT protocol, just drop it.

Eric
--
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