Re: Determining Application Inactivity
Re: Determining Application Inactivity
- Subject: Re: Determining Application Inactivity
- From: Nathaniel Talbott <email@hidden>
- Date: Tue, 23 Dec 2003 11:31:32 -0500
On Dec 22, 2003, at 19:38, Shoaib wrote:
What is the best way to determine if an application has been inactive
for a set period of time? I want to take action if my application has
been inactive for 5 mins.
I've researched ways of doing this but haven't found an answer. Any
help would be appreciated.
I've just been researching this, and seem to have a found an answer for
doing this at the system level. I grep'd through the Fire source (I
love open source!) and found this incantation:
extern double CGSSecondsSinceLastInputEvent(unsigned long evType);
A google turned up the following in a CVS diff:
// -1 is all apps
// 0 is time since system came out of sleep?
// 1 is seconds since last mouse click
Unfortunately, I don't know what the event type would be for just the
current application, or even if there is an event type for that.
Perhaps someone else can fill in that blank? Google results were very
sparse, so I was glad to find what I did :-/
A few additional questions I have:
- Is this function documented anywhere?
- What does CGS stand for?
- Is there a header that can be imported for this instead of just
conjuring it up out of the air?
- Is there a good chance this API will change in the future? Is that
why it's not documented?
Anyhow, I hope that helps you out,
Nathaniel
<:((><
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.