How to detect that a PC has been idle for 30 seconds using Java?
EDITED
With idle I mean that there are no user activity. The user does nothing in 30 seconds. I wold like to do an apllication like Windows, that detects that the user does nothing and enter in stad-by.
I've come across this excellent example of detecting system wide idle time using JNA. Java Native Access (JNA) is a library that provides access to Java Native Interface (JNI) without the need for you to actually write native code.
Here's the example that is very close to what you're asking for.
Not possible as requested, but you can create workarounds using the java.lang.management API. A JNI implementation can also be found on javaworld.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With