开发者

Java keyboard hook

开发者 https://www.devze.com 2022-12-18 19:02 出处:网络
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 part开发者_运维技巧y libraries that can detect global k

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 part开发者_运维技巧y libraries that can detect global keyboard/mouse use?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消