Re: User idleness in Mac.
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