• 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: System Idle Time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: [Moderator] Re: Cocoa-Java and the Future
  • Next by Date: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Previous by thread: Re: System Idle Time
  • Next by thread: Re: System Idle Time
  • Index(es):
    • Date
    • Thread