Re: How do I know the screensaver is active?
Re: How do I know the screensaver is active?
- Subject: Re: How do I know the screensaver is active?
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sun, 28 Dec 2003 15:48:50 +0100
On 25 Dec 2003, at 09:36, Arthur VIGAN wrote:
I would like to know if there is a way to know when the screensaver is
launched (maybe a notification?). I have an application that needs
lots of CPU, and I would like to launch it only when the user isn't
working on his computer, for instance when the screensaver is running.
Another way would be to launch the process during idle time. But I do
> I know when the user last used the mouse of the keyboard?
Carbon has Event Loop Idle Timers which are called whenever the user
has been idle for a certain time, and are then called repeatedly
until they do something again.
AFAIK the only way to detect whether the screen saver is running is
to look at the list of running processes (using the proper Unix API -
the higher level ones will filter out Unix daemons) and look for
"ScreenSaverEngin". Though, with the advent of the kqueue, this may
be easier if you can require 10.3.
I think I posted some code that does that a while ago. Could have
been on the Carbon mailing list, though.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.