Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use java to capture keyboard and mouse event in background?

I want to write an application that runs in the background and waits for the user to press a key in any other application. When the key is pressed, my application will do something.

Is this possible in Java? If so, how can this be accomplished?

like image 957
Mostafa Jamareh Avatar asked Oct 21 '22 03:10

Mostafa Jamareh


1 Answers

JNativeHook provides a Java-based API for native keyboard and mouse event hooks.

like image 99
S. Alcic Avatar answered Oct 23 '22 10:10

S. Alcic