Re: Inactivity Timer
Re: Inactivity Timer
- Subject: Re: Inactivity Timer
- From: Rob Keniger <email@hidden>
- Date: Wed, 25 Nov 2009 09:32:32 +1000
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 (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