Re: System Idle Time
Re: System Idle Time
- Subject: Re: System Idle Time
- From: "Mike Lewis" <email@hidden>
- Date: Wed, 27 Oct 2004 00:03:59 +0000
What should I link to my application? I linked
ApplicationServices.framework, but still got linker error, undefined symbols
CGSSecondsSinceLastInputEvent ...
If this is unofficial and undocumented way, so what is the official way of
getting the system idle time?
Here's some GPL code from Adium:
//Returns the current # of seconds the user has been idle
- (double)currentIdleTime
{
double idleTime = CGSSecondsSinceLastInputEvent(-1);
//On MDD Powermacs, the above function will return a large value when
the machine is active (-1?).
//Here we check for that value and correctly return a 0 idle time.
if(idleTime >= 18446744000.0) idleTime = 0.0; //18446744073.0
return(idleTime);
}
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden