Transition from [NSEvent phase] to [NSEvent momentumPhase]
Transition from [NSEvent phase] to [NSEvent momentumPhase]
- Subject: Transition from [NSEvent phase] to [NSEvent momentumPhase]
- From: Markus Spoettl <email@hidden>
- Date: Sun, 11 Mar 2012 20:43:14 +0100
Hello,
in a custom view I'm processing -scrollWheel: events for smooth
scrolling using the trackpad.
When the user flicks across the trackpad, scrolling events first go
through a phase cycle delivered through [NSEvent phase]
(NSEventPhaseBegan -> NSEventPhaseChanged -> NSEventPhaseEnded).
After that (depending on how the flick ended physically), the system may
deliver additional scrolling events with [NSEvent momentumPhase] set
(NSEventPhaseBegan -> NSEventPhaseChanged -> NSEventPhaseEnded).
A typical sequence of events looks like:
phase: NSEventPhaseBegan / momentumPhase: NSEventPhaseNone
phase: NSEventPhaseChanged / momentumPhase: NSEventPhaseNone
[...]
phase: NSEventPhaseChanged / momentumPhase: NSEventPhaseNone
phase: NSEventPhaseEnded / momentumPhase: NSEventPhaseNone
phase: NSEventPhaseNone / momentumPhase: NSEventPhaseBegan
phase: NSEventPhaseNone / momentumPhase: NSEventPhaseChanged
[...]
phase: NSEventPhaseNone / momentumPhase: NSEventPhaseChanged
phase: NSEventPhaseNone / momentumPhase: NSEventPhaseEnded
The trouble is that there seems no way of knowing that there will be
momentumPhase events following a "normal" phase cycle. I need to do
cleanup but I must be sure scrolling is over before doing it.
The system knows (at the time of sending the final normal -phase event)
that it's going to send additional -momentumPhase events. Is there a way
to find out?
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden