Yes, there is an API for this in macOS, and I use it in two of my apps (multitouch.app and charmstone.app). The haptic feedback is really subtle though and it doesn't give the full power of the feedback that is in the trackpad, which limits the usefulness of it. You can make it buzz for longer durations to make it more apparent, but then it starts to get annoying. I think there is a private framework that can give you stronger haptic feedback, if I remember right (I avoid private frameworks).
No comments yet.