Re: determining system idle time in leopard
Re: determining system idle time in leopard
- Subject: Re: determining system idle time in leopard
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 18 Sep 2008 15:57:08 -0400
- Thread-topic: determining system idle time in leopard
on 2008-09-18 7:03 AM, Memo Akten at email@hidden wrote:
> In my app I'd like to check for system idle time, and perform an
> action after a set amount of time. I've found this code to check for
> system idle time
> http://www.cocoabuilder.com/archive/message/cocoa/2004/10/27/120354
>
> is this still the best way to do it on leopard?
Look at the Quartz Event Services Reference document and the
CGEventSourceSecondsSinceLastEventType function. Pass kCGAnyInputEventType
in the eventType parameter to get the seconds since the last event of any
type. For most purposes, the source parameter value should be an event
source created using kCGEventSourceStateCombinedSessionState. I believe this
is available and documented for Tiger and Leopard.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
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