Re: No double click event available to an NSView?
Re: No double click event available to an NSView?
- Subject: Re: No double click event available to an NSView?
- From: Uli Kusterer <email@hidden>
- Date: Fri, 9 Feb 2007 21:33:31 +0100
Am 05.02.2007 um 02:57 schrieb Scott Stevenson:
For whatever it's worth, this has worked reliably for me:
if ([event clickCount] > 1) {
// do something
} else {
// do something else
}
Maybe it depends on what you're trying to do.
In any case, I'm not sure you want to setup your own timer since
System Preferences allows the user to set a global double-click
speed. A person may be surprised if that differs in one application.
Steve,
your code always assumes that a double click is the same as a
single click plus an extra action. Ken's code OTOH doesn't perform
the single click action at all when it detects a single click. There
are cases where both is needed (I think double-clicking one file in a
multiple selection with the shift key still held down in Finder works
Ken's way).
I think CoreServices or Carbon contains a call to get the correct
double-click interval. Way back in the day it used to be called
GetDblTime or LMGetDblTime. Maybe that helps find it.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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