• 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
Re: Notification for Idle Time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notification for Idle Time?


  • Subject: Re: Notification for Idle Time?
  • From: John Stiles <email@hidden>
  • Date: Tue, 11 Dec 2007 10:29:27 -0800

I've found out the hard way that CFRunLoops and NSRunLoops have subtle differences; one really can't substitute for another. (e.g. Cocoa callbacks will not fire on a CFRunLoop, or calling a CF routine to stop a run-loop will fail to stop an NSRunLoop)
It's unfortunate since the NSRunLoop API and CFRunLoop API each have interesting functionality that would be useful to have on the "other side."



Christopher Hickman wrote:
On Tuesday, December 11, 2007, at 06:23AM, "Gregory Weston" <email@hidden> wrote:
Christopher Hickman wrote:

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?
Not an NSNotification.

InstallEventLoopIdleTimer

<http://developer.apple.com/documentation/Carbon/Conceptual/ Carbon_Event_Manager/Tasks/chapter_3_section_11.html>
<http://developer.apple.com/documentation/Carbon/Reference/ Carbon_Event_Manager_Ref/Reference/reference.html#//apple_ref/c/func/ InstallEventLoopIdleTimer>

Does anybody know if it is possible to get an EventLoopRef from my NSApplication's run loop? Greg found something that does exactly what I need, but it requires that I specify the run loop "the Carbon way" as an EventLoopRef. I just don't know how to reference my application's run loop as a Carbon EventLoopRef. _______________________________________________

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
_______________________________________________

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


References: 
 >Re: Notification for Idle Time? (From: Gregory Weston <email@hidden>)
 >Re: Notification for Idle Time? (From: Christopher Hickman <email@hidden>)

  • Prev by Date: Re: Notification for Idle Time?
  • Next by Date: Re: Key Value Observing?
  • Previous by thread: Re: Notification for Idle Time?
  • Next by thread: Re: Notification for Idle Time?
  • Index(es):
    • Date
    • Thread