Java keyboard

I would like to write a Java application that counts how long I have been using a keyboard or mouse without interruption. Are there any built-in classes or third-party libraries that can define a global keyboard / mouse?

+3
source share
2 answers

It can only be using the window hook function using JNI. Someone has already posted the code here.

EDIT: this is better, as are mouse events

+1
source

Collecting files for rawinputsharp and an accompanying article may be helpful. This is not specific to Java, but I hope you can adapt it for the better.

0

Source: https://habr.com/ru/post/1730229/


All Articles