Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa Java: finding user idle time

Cocoa Java: finding user idle time
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Mar 5, 2002, 11:42 PM
 
Does anyone know how to find how long a user has been idle for? I have an app, which after a period of idle time, I want it to do something. If anyone has any suggestions they would be appreciated.

TIA
     
Forum Regular
Join Date: Jan 2001
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 6, 2002, 01:21 PM
 
Originally posted by macrophyllum:
<STRONG>Does anyone know how to find how long a user has been idle for? I have an app, which after a period of idle time, I want it to do something. If anyone has any suggestions they would be appreciated.</STRONG>
Define "idle." No mouse movement? No keyboard action? No network data? If idle is defined as no input from know sources (keyboard and mouse) then you could probably just put some listener which watches NSEvents and runs in a timer. You may have to do some trickery with a floating window always be topmost to get events. To do it as a faceless entity, you'll probably have to dive into Carbon to watch it at a low level and then message your app that some time/idleness threshold has been crossed.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Apr 23, 2002, 03:08 PM
 
By Idle, I mean no keyboard or mouse events. Could you explain a little more about how to listen to NSEvents, I am pretty new at this.

Thanks.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2