I'm handling some mouse dragging tasks modally by implementing my own modal 
event loop using [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:].

I'm wondering what is the usual correct thing to pass for the 'untilDate' 
parameter. For a long time I've been using [NSDate distantFuture], but the 
documentation of this method says that by passing nil it uses [NSDate 
distantPast], which implies perhaps that this is a more usual default. In 
thinking about this I realise I don't really understand what this parameter is 
doing, especially when 'distantPast' is specified - does that mean do not wait 
at all for any events and only return one if it's already queued?

I've changed this to pass nil and my mouse dragging works as normal.

What set me looking at this is a strange report of this loop going screwy for 
one user, which I can't reproduce. According to the logs from that user, 
suddenly several 'mouseUp' events are delivered one after the other which seems 
impossible, and that confuses my code. Can anyone think of any reason why 
multiple mouseUps could be delivered (i'm passing YES for the dequeue 
parameter)? I'm wondering if a third-party extension could be interfering with 
events somehow - anyone heard of anything like that?


--Graham



_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to