Reputation: 2018
It seems scrollWheel: has to be it, for receiving these. Unfortunately the trackpad's scrolling deltas are orders of magnitude higher than a mouse's, so the scroll speed is psychotically high. Ergo I need to distinguish them so that I can apply an appropriate dampener.
The docs perplexingly note that while you usually do this by checking NSEvent's subtype, in scrollWheel: specifically that doesn't work. But they don't say what you should do. Experimentation has shown me that while trackpad scrolls are indeed not correctly typed as NSTouchEventSubtype, their type is different from mouse wheel scrolls - NSTabletPointEventSubtype vs NSMouseEventSubtype. The problem is, NSTabletPointEventSubtype is also what's used for genuine tablet scroll events, and the deltas in those are even more ridiculously high. So I need to distinguish those too.
NB: Similar prior questions include this, where the only suggestion was inference based on an undocumented API, or others featuring similar hacks. Some seem to be recommending that you ignore scrollWheel: entirely and track touch events manually, but that seems to be a lot of redundant work that might break in future OS releases.
Upvotes: 3
Views: 1228
Reputation: 454
I believe [event hasPreciseScrollingDeltas]
is what you're looking for. It's available in OS X 10.7.
Upvotes: 1