• 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
How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Core Animation Deadlock
  • Next by Date: Re: How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
  • Previous by thread: Re: Authorization
  • Next by thread: Re: How to catch all mouse clicking (or avoid multiple click filtering in startTrackingAt)
  • Index(es):
    • Date
    • Thread