views:

344

answers:

2
+1  Q: 

Java keyboard hook

I would like to write a Java app that counts how long I have been using the keyboard or mouse w/o a break. Are there any built-in classes or 3rd party libraries that can detect global keyboard/mouse use?

A: 

The collection of files for rawinputsharp and the accompanying article might prove helpful. It's not Java-specific, but hopefully you can adapt it to suit.

Darth Continent
+1  A: 

This can only be by using windows's hook function by JNI Someone already posted code here

EDIT: this on is better it also covers mouse events

stacker