• 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
Re: Handling "Smart Zoom" gesture?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling "Smart Zoom" gesture?


  • Subject: Re: Handling "Smart Zoom" gesture?
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 28 Jun 2012 20:17:14 -0700

On Jun 28, 2012, at 19:57 , Graham Cox wrote:

> - (void)	touchesBeganWithEvent:(NSEvent*) event
> {
> 	NSSet* touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:self.view];
>
> 	if([touches count] == 2 )

Well, this looks wrong to me. In general, each of the 2 touches is going to begin at a different time, which means this method will be called twice, and there's only be one touch in the set at each call. (The touch that began earlier is in a different phase at this event.)

I would expect this code to work only if both fingers hit the trackpad simultaneously. That's probably not very hard to do, which is why it works sometimes but only flakily.

I think what you need to to is add up *all* the touches in all phases [well, at least in "began" and "moved" phases, not sure about the others] at *any* of the touch responder methods, to work out how many touches are present simultaneously. Even that won't ensure that the touches begin close together in time, though, which you may or may not care about.


_______________________________________________

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: Handling "Smart Zoom" gesture?
      • From: Graham Cox <email@hidden>
    • Re: Handling "Smart Zoom" gesture?
      • From: Graham Cox <email@hidden>
References: 
 >Handling "Smart Zoom" gesture? (From: Graham Cox <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: "Richard Altenburg (Brainchild)" <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: Graham Cox <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: "Richard Altenburg (Brainchild)" <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: Graham Cox <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: Quincey Morris <email@hidden>)
 >Re: Handling "Smart Zoom" gesture? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Handling "Smart Zoom" gesture?
  • Next by Date: Re: Handling "Smart Zoom" gesture?
  • Previous by thread: Re: Handling "Smart Zoom" gesture?
  • Next by thread: Re: Handling "Smart Zoom" gesture?
  • Index(es):
    • Date
    • Thread