Question about Linux MT Protocol B type

Peter Hutterer peter.hutterer at who-t.net
Fri May 22 03:32:28 UTC 2020


On Thu, May 21, 2020 at 07:42:33PM +0900, 강정현 wrote:
> Dear all,
> 
> I have an one question about Linux MT Protocol B type.
> 
> Asume that press touch screen using first finger.
> 
> And release fisrt finger and press second finger toghether.
> 
>  
> 
> In that case, which procotol is correct?
> 
> ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
> │ ABS_MT_SLOT 0                                                                                                         │
> │                                                                                                                       │
> │ ABS_MT_TRACKING_ID 1                                                                                                  │
> │                                                                                                                       │
> │ ABS_MT_POSITION_X 10                                                                                                  │
> │                                                                                                                       │
> │ ABS_MT_POSITION_Y 5                                                                                                   │
> │                                                                                                                       │
> │ ABS_MT_SYNC <-- first finger press                                                                                    │
> └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

There's no such thing as ABS_MT_SYNC, use SYN_REPORT here.

> first case
> 
> ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
> │ ABS_MT_TRACKING_ID -1                                                                                                 │
> │                                                                                                                       │
> │ ABS_MT_TRACKING_ID 2                                                                                                  │
> │                                                                                                                       │
> │ ABS_MT_POSITION_X 15                                                                                                  │
> │                                                                                                                       │
> │ ABS_MT_POSITION_Y 10                                                                                                  │
> │                                                                                                                       │
> │ ABS_MT_SYNC <-- first finger release and first finger press is generated                                              │
> └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Nope, that's wrong. You could skip the tracking ID -1 event and switch
directly to ID 2. This is technically allowed by the protocol but
a lot of userspace (anything Xorg and libinput) will struggle with it
for historical reasons. Where you are re-using the same slot, you should
always stop a touch and start the next touch in a separate frame.

Direct switching also introduces some ambiguity because it merely means
"kernel lost tracking of touch point", so userspace now has to decide
whether it's the same touch or a new touch.

> 
> second case
> 
> ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
> │ ABS_MT_TRACKING_ID -1                                                                                              │
> │                                                                                                                    │
> │ ABS_MT_SLOT 1                                                                                                      │
> │                                                                                                                    │
> │ ABS_MT_TRACKING_ID 2                                                                                               │
> │                                                                                                                    │
> │ ABS_MT_POSITION_X 15                                                                                               │
> │                                                                                                                    │
> │ ABS_MT_POSITION_Y 10                                                                                               │
> │                                                                                                                    │
> │ ABS_MT_SYNC <-- first finger release and second finger press is generated                                          │
> └────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

this is the correct sequence (except for the ABS_MT_SYNC bit :).

Cheers,
  Peter


More information about the wayland-devel mailing list