How to detect desktop idle time?


Hi guys!

I need my app to respond to an event in which the user has been idle for X minutes (i.e. no mouse movements or keyboard inputs in that time).

How can I access such idle time data?


I came here because I was also looking for a solution. I found that this could be possibly used for detecting system idleness.