macOS: trackpad touch events
shaunlebron opened this issue · comments
Looking at adding access to macOS trackpad touch events. Some references to start:
- Magic: an example mac app that uses trackpad touch events for drawing
- docs on macos touch events
- edit: docs on web touch events
- edit: how SDL tracks touch events on macOS
I think web api should be studied for this too
setAcceptsTouchEvents:YES
seems to be deprecated for allowedTouchTypes. I had to find a usage example on GitHub.
The acceptsTouchEvents
property also seemed necessary. Does Apple have newer docs on this?
I confirmed that the touch events are being caught now (see 49a4483). I will look at logging the touch event data to the window.
I added EventTrackpadTouch*
events and the dashboard event panel is logging them successfully. I will look at drawing the touch points in a new trackpad panel.
That would be cool!
I put a trackpad panel next to the mouse panel:
CleanShot.2022-12-01.at.13.27.59.mp4
Problems so far:
- The dashboard starts hiccuping when I move the touch points too quickly. Not sure what’s going on there.
- Touch point state goes out of sync if you use a four-finger gesture that exits the view (swipe up, down, out or in). Not sure how to get external touch events to keep those in sync.