Re: detecting a double click ahead of time
Re: detecting a double click ahead of time
- Subject: Re: detecting a double click ahead of time
- From: Jim Correia <email@hidden>
- Date: Tue, 21 Oct 2003 21:15:44 -0400
On Oct 21, 2003, at 7:22 PM, Ambroise Confetti wrote:
Le mercredi, 22 oct 2003, ` 00:06 Europe/Paris, Alastair J.Houghton a
icrit :
Whilst we're on this topic, does anyone know how to read the
double-click speed (the one from Preferences) from Cocoa? I've seen
the Carbon GetDblTime() function, which will obviously work, but it'd
be nice to know if there's an equivalent in Cocoa (e.g. is it in the
defaults database?).
sudo fs_usage | grep Preferences
(grep is there to make the output readable... could be smarter than
that but that's enough)
Open System Preferences and play a little bit with mouse settings...
... and you get...
~/Library/Preferences/.GlobalPreferences.plist
They made it invisible!
The key for the double click interval didn't show up in my preferences
file until I adjusted the factory default in the prefs panel. It
doesn't appear that a default value is registered in the default
registration domain at startup either.
This doesn't appear to be a documented value, and you probably ought
not to go read it directly or rely on it being there (see above).
All Cocoa applications link against Carbon anyway (you wouldn't get
menus, printing, apple events, etc. without it.)
Since the carbon API is documented, you should probably just use it,
wrapping it into an obj-c method if you'd like.
Something like...
- (float)doubleClickInterval
{
return GetDblTime() / 60.0;
}
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.