On Feb 1, 2010, at 2:08 PM, Eric Gorr wrote: > performSelector:withObject:afterDelay: will only perform the selector after a > delay after the mouse button goes up. I had actually tried doing this > manually with the code > > NSTimer *mouseStillDownTimer = [NSTimer timerWithTimeInterval:1 target:self > selector:@selector(mouseStillDown:) userInfo:NULL repeats:NO]; > NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; > > [currentRunLoop addTimer:mouseStillDownTimer forMode:NSDefaultRunLoopMode]; > > when I first noticed the timers (which performSelector:withObject:afterDelay > relies upon) don't fire until after the mouse button goes up.
That's probably because you're installing the timer in the default runloop mode. While the mouse is down, AppKit is tracking the mouse using NSEventTrackingRunLoopMode. Try using that mode (or possibly , NSRunLoopCommonModes) instead. -eric _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com