On 25/11/2009, at 8:37 AM, Kevin wrote:

> I needed to implement an inactivity timer in my Cocoa App and did so my 
> subclassing NSApplication and overriding sendEvent: to start and stop a 
> timer. Although it works most of the time, every once in a while my timer 
> gets fired as I'm typing text into a text field or interacting with some 
> other control like scrolling a table view.


You might want to look at Uli Kusterer's UKIdleTimer, which is a Cocoa wrapper 
around the Carbon EventLoopIdleTimer, which is a system-provided timer that 
only fires when the machine has been idle for a specified amount of time:

http://www.zathras.de/angelweb/sourcecode.htm#UKIdleTimer

--
Rob Keniger



_______________________________________________

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

Reply via email to