• 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: User idleness in Mac.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User idleness in Mac.


  • Subject: Re: User idleness in Mac.
  • From: Brian Bergstrand <email@hidden>
  • Date: Wed, 19 May 2010 17:22:45 +0300

From CGEventSource.h:

CG_EXTERN CFTimeInterval CGEventSourceSecondsSinceLastEventType(
  CGEventSourceStateID stateID, CGEventType eventType)
  CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA);

The value returned is the number of idle seconds. Unfortunately, there's no event sent, so you have to poll or roll your own event mechanism. This is more work, but can be done with a CG event tap.

p.s. While the above API states 10.4, there was a bug in 10.4 that could cause system hangs if this is called, so 10.5 is really the min sys ver.

On May 19, 2010, at 4:50 PM, Arnab Ganguly wrote:

> How do I detect user idle in Mac OS X.Is it possible to get such event ?
> Thanks,
> -A
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >User idleness in Mac. (From: Arnab Ganguly <email@hidden>)

  • Prev by Date: User idleness in Mac.
  • Next by Date: KLAcquireInitialTickets(NULL, NULL, NULL, NULL) returns klParameterErr (19276) on Mac OS X 10.6.3
  • Previous by thread: User idleness in Mac.
  • Next by thread: KLAcquireInitialTickets(NULL, NULL, NULL, NULL) returns klParameterErr (19276) on Mac OS X 10.6.3
  • Index(es):
    • Date
    • Thread