I have an NSWindow
containing a subclassed NSOpenGLView
. When using the wheel of a mouse, then every wheel step yie开发者_StackOverflow社区lds 0.1 if turning the wheel slowly. When using the multitouch pad of a macbook and scrolling slowly, then I get many events with deltaY of 0.0 and sporadically one with 0.3 or 0.4. Does anybody know where this comes from and how it can be switched off? When scrolling in a text editor with the multitouch pad it seems to work.
What do you mean by “switched off”? Such events are a natural result of tracking touches rather than integer increments of a scroll wheel, and if you’re correctly scaling by the delta they should have no effect.
If you need more complex control of scrolling behaviour, OS X 10.7 adds a new NSEventPhase
type and phase
property for distinguishing between different parts of a touch scroll event (I expect the 0-delta events correspond to NSEventPhaseStationary
).
精彩评论