-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
When pressing a single finger on an Apple Magic Trackpad on macOS to make a mouse button click, 2 FINGER_DOWN and 2 FINGER_UP events are received like this:
GPE: Finger: 0x6000022e4240 DOWN. Device: 0xffffffffffffffff
GPE: Finger: 0x1 DOWN. Device: 0xffffffffffffffff
LTS: MOUSE_DOWN - button: left
GPE: Finger: 0x1 UP. Device: 0xffffffffffffffff
LTS: MOUSE_UP - button: left
GPE: Finger: 0x6000022e4240 UP. Device: 0xffffffffffffffff
Finger ID 0x1 is SDL_BUTTON_LEFT. The number of fingers reported down by SDL_GetTouchFingers on the second finger down is 2. Clearly incorrect.
Also every time the finger is moved while pressed, 2 FINGER_MOTION events are received.
On a Windows and Linux Notebook only one FINGER_DOWN and one FINGER_UP is received. The finger has the ID SDL_BUTTON_LEFT.
On a Windows guest running on a Parallels VM on the same MacBook as host and with the same trackpad where the above was observed there is similarly only one FINGER_DOWN and FINGER_UP event with Id SDL_BUTTON_LEFT. Therefore this looks like a bug in SDL's handling of macOS touch events rather than macOS generating these extra events.
One you know what is going on, it is easy to work around, ignore finger events with ID 0x1 if you are on macOS. But until then it causes mysterious failures of multitouch gesture handling because code gets confused about how many fingers are down.
This is with SDL3 but the symptoms which I tracked to this problem were present with SDL2 as well.