How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
- Subject: How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
- From: "Joan Lluch (casa)" <email@hidden>
- Date: Fri, 25 Apr 2008 08:29:03 +0200
I have implemented a NSButtonCell subclass in the usual way to catch
mouse tracking. I get the startTrackingAt and stopTracking messages
called correctly on the first click of the mouse. However the
startTrackingAt is not quickly called again if I quickly click again
the mouse, such as if I did a double click. I mean, if I perform a
double or triple click I only get one pair of startTrackingAt and
stopTracking calls instead of the desired two or three pairs. So the
desired behaviour is to be able to catch all the mouse clicking
activity in almost real time. What I get instead is some filtering of
the actual mouse clicking. This is the way I implemented the methods
@implementation TrackButtonCell
+ (BOOL)prefersTrackingUntilMouseUp
{
return YES ;
}
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
{
NSTableView *tableView = (NSTableView *)controlView ;
// do something
NSLog( @"mouse down\n") ;
return YES ;
}
- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:
(NSView *)controlView mouseIsUp:(BOOL)flag
{
NSTableView *tableView = (NSTableView *)controlView ;
// do something
NSLog( @"mouse up\n" ) ;
}
@end
I observed that if I set the faster double click rate in System
Preferences, then I am able to catch all the clicking activity, so
the issue must be related to some multiple click filtering that Cocoa
does before calling the above code.
Sorry for my simple English, it is not my native language though I
try to do my best, I hope you all will understand.
Thanks in advance for any reply.
Joan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden