Detecting user-activity on mac os x

Posted by Nobik on Stack Overflow See other posts from Stack Overflow or by Nobik
Published on 2010-05-27T16:17:29Z Indexed on 2010/05/27 16:21 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

I use the function "IOPMSchedulePowerEvent" to schedule Sleep or Wake-Events and registered my daemon with "IORegisterForSystemPower" to receive power-state-changes. Everything works fine!

When system going sleep and later waking up at scheduled time, my daemon do some work, and after it system should going sleep again.

Now my questions:

  1. How can i detect, if the system was awaked by user or by the scheduled time?

  2. How can i detect, if a user currently working with the system, so the daemon have not to put it in sleep-mode???

Thanks Nobik

© Stack Overflow or respective owner

Related posts about c

    Related posts about osx