• 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: Determining Application Inactivity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Determining Application Inactivity (From: "Shoaib" <email@hidden>)

  • Prev by Date: Re: Database Application with Obj-C
  • Next by Date: Re: Database Application with Obj-C
  • Previous by thread: Determining Application Inactivity
  • Next by thread: People who develop with MySQL and/or other GPL based code
  • Index(es):
    • Date
    • Thread