Re: discovering if a process is busy
Re: discovering if a process is busy
- Subject: Re: discovering if a process is busy
- From: Bill Cheeseman <email@hidden>
- Date: Wed, 19 Dec 2007 16:41:09 -0500
- Thread-topic: discovering if a process is busy
on 2007-12-19 3:23 PM, justin webster at email@hidden wrote:
> So is there any way to figure out if a process is busy or idle?
> I understand there was a way in OS9 to establish the total time a
> process has been active but it apparently returns 0 in OSX.
>
> I am basically trying to establish that a process is idle before
> sending it keystrokes.
There are functions in Quartz Event Taps -- a C API -- that return the
elapsed time since the last hardware input event of any kind, and also since
the last hardware input event of specified kinds. If I recall correctly --
it's been a long day -- you can limit the functions to specific applications
as well as getting the information globally. The event taps API is available
in Tiger and Leopard. Look at the "Quartz Event Services" documentation.
I would give you a more precise documentation reference, but Xcode now
always crashes when I try to search the documentation -- since uploading the
December docset updates.
Just because the user isn't hitting the keyboard or moving the mouse doesn't
mean the application is idle, of course. It might be running a lengthy
operation, or doing something on a timer, or being manipulated via Apple
events or other means, locally or over a network.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden