Is there any way to tell whether a pair of mouse up / down events were triggered by a tap on the trackpad, versus a trackpad depression resulting in a click?
Essentially, I'd like to replicate the behavior you see in toggle check boxes throughout macOS. They have four states:
- Toggled off: no check
- Toggled on: check mark
- Activated off: no check / grey background
- Activated on: check mark / grey background
If a tap is recognized on a checkbox, it'll go from 1 -> 2 or 2 -> 1 after a brief delay (~0.5s) without showing the grey background at all. However if you physically click the trackpad, you'll go from 1 -> 3 immediately on mouse-down, and then from 3 -> 2 if the mouse-up comes on the checkbox (otherwise it goes back to 1).
It seems that to replicate this behavior one needs to differentiate between a tap-like mouse-down and a click-like mouse down. As far as I can tell there is no way to do this by inspecting NSEvent in NSView.mouseDown.