Monday, April 11, 2011

Monitoring user idle time

Developing a mac app, how can I tell whether the user is currently at their computer or not? Or how long ago they last pressed a key or moved the mouse?

From stackoverflow
  • You can use Quartz event taps and an NSTimer. Any time one of your event taps lights up, postpone the timer by setting its fire date. When the timer fires, the user is idle.

    I'm not sure whether Quartz event taps are exposed to Python, though. The drawing APIs are, but I'm not sure about event taps.

  • it turns out the answer was here

    http://osdir.com/ml/python.pyobjc.devel/2006-09/msg00013.html

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.