Re: Notification for Idle Time?
Re: Notification for Idle Time?
- Subject: Re: Notification for Idle Time?
- From: Ron Fleckner <email@hidden>
- Date: Tue, 11 Dec 2007 09:16:02 +1100
On 11/12/2007, at 7:42 AM, Christopher Hickman wrote:
Hello all,
I'm working on something that needs to know when the computer has
had no user input for a period of time. How does the Screensaver
Engine know when the user has been idle long enough to start? I
need to do the same thing and I can't find any Cocoa methods that
provide that information.
I found something that suggested I could get this information from
IOKit, but it looks like I'd have to constantly poll the idle time,
and polling sucks. Anyone know if there is an NSNotification I can
receive for idle times?
Thanks,
Christopher
Hi Christopher,
I think this document will help:<http://developer.apple.com/qa/qa2006/
qa1442.html>. You could use a timer and reset it whenever one of the
notifications is received, but fire your own method after whatever
time you want. In the referenced document, it looks like NSWorkspace
notification center will do for you.
HTH,
Ron
_______________________________________________
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