• 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: No double click event available to an NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >No double click event available to an NSView? (From: Ken Tozier <email@hidden>)
 >Re: No double click event available to an NSView? (From: Ricky Sharp <email@hidden>)
 >Re: No double click event available to an NSView? (From: Ken Tozier <email@hidden>)
 >Re: No double click event available to an NSView? (From: Scott Stevenson <email@hidden>)

  • Prev by Date: Process monitoring
  • Next by Date: Re: unsigned long long + id = ???
  • Previous by thread: Re: No double click event available to an NSView?
  • Next by thread: Customize NSAlert?
  • Index(es):
    • Date
    • Thread