• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Transition from [NSEvent phase] to [NSEvent momentumPhase]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
      • From: Raleigh Ledet <email@hidden>
    • Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
      • From: Markus Spoettl <email@hidden>
  • Prev by Date: Re: Forcing subclass creation through method swizzling not airtight?
  • Next by Date: Re: Calling objc_getAssociatedObject in -finalize.
  • Previous by thread: Re: Forcing subclass creation through method swizzling not airtight?
  • Next by thread: Re: Transition from [NSEvent phase] to [NSEvent momentumPhase]
  • Index(es):
    • Date
    • Thread