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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to