1 Reply
      Latest reply on May 20, 2020 5:08 AM by Claude31
      qitianshi Level 1 Level 1 (0 points)

        Hi! I'm making a macOS app with SwiftUI and I want to be able to detect the x-y coordinates of the user's finger on the trackpad. How can I do this?

        I'd like it to be able to detect as long as the finger is resting on the trackpad, not just when it's pressed down or dragging. Also, I'd ideally like to be able to get the coordinates of more than one finger. To illustrate what I want, the AudioSwift app uses the trackpad as a MIDI controller (video).

        Everything I've found online was from 10 years ago back in the days of Obj-C. Can some kind soul provide and updated code that preferably works with SwiftUI? Also, I'm really new to app development in general, so I'd appreciate if you could explain it simply. Thanks!