Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
- Subject: Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
- From: Markus Spoettl <email@hidden>
- Date: Fri, 16 Mar 2012 19:38:18 +0100
Hello,
I take it either (a) I'm the only one here having this problem or (b)
it is so badly explained that no one knows that I'm talking about? If
it's (b) I can try again...
Regards
Markus
On 11.03.12 20:43, Markus Spoettl wrote:
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