Comment 29 for bug 1015183

Revision history for this message
Chase Douglas (chasedouglas) wrote : Re: [Bug 1015183] Re: Inconsistent mouse events for Acer T231H multitouch monitor

On 07/04/2012 03:37 AM, Martin von Gagern wrote:
> With that patch by Chase, I also wonder what would happen if two touch
> devices were used simultaneously.
>
> When I both touch my screen and click my conventional mouse button, I
> get two button events, but the state is the bitwise or of both, so the
> second click will be "pressed button 1 while button 1 was pressed".
> Makes sense, in a certain way, although it might well confuse some
> applications.
>
> But what if I had two touch devices controlling the core pointer? I
> believe it is likely with the current setup that in this case, the
> second device would generate a ButtonPress with state 0x000. Or is it
> impossible for more than one touch device to control the core pointer at
> a given time? I don't have more than one device, so I can't test this.
>
> I'll agree that given current technology, this seems a rather rare
> corner case, and probably not worth the effort to deal with properly.
> But any shortcomings in that respect should perhaps at least be
> documented somewhere.

Great point here :). I had to look at the code to determine the correct
answer. I worried that, like you said, it would be buggy if you had two
touchscreens. However, this should not be a problem.

Input devices have a two-layer hierarchy. There are slave devices and
master devices. Slave devices represent a physical device, like a
touchscreen. Master devices represent a group of slave devices. Most
people only have one master device configured, and all the slave devices
are attached to it. If you have two mice, you can create a second master
and attach one slave mouse to each. Then you'll have two independent
pointers on screen :).

A client can listen to events from master and/or slave devices. The
events look and behave almost exactly the same. When you press your
mouse button, a button press event is generated for the slave device and
the attached master device.

If you have two touchscreens with one master, then each slave device can
emulate a button press event. However, there can be only one emulated
touch per device (no matter whether it's a slave or a master), so the
first touch is emulated for the master, and the second touch is not.

Thanks!