detecting user idle (no user input) time globally on Linux or better cross platform
Is there a开发者_StackOverflow中文版 way to detect no user input (mouse or keyboard) using Python in Linux. I've found some recipes for Windows and Mac but not something consistent. I am assuming there is no cross platform alternative or library unless I missed it.
There is no cross-platform solution, but I made a very simple python 2 module for X11 that specifically addresses your concern: http://pypi.python.org/pypi/actmon
actmon.get_idle_time()
returns the age of last user activity in milliseconds.
精彩评论