How to listen to keyevents outside a frame? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to listen to keyevents outside a frame?

Ist there any way to detect keyevents outside of a frame in Java? I just know the KeyListener that is only listening to Events inside a frame. if you minimize or unselect the frame there will be no more Events being called.

22nd Jul 2017, 9:25 AM
ILurch
ILurch - avatar
1 Answer
+ 1
i dont think there is an easy way to achieve this using the java standard library (atleast there wasn't a few years back when i needed this). I use a library calle JNativehook that's free and available from the internet to achieve the functionality
11th Aug 2017, 5:28 PM
Hannes Sederholm
Hannes Sederholm - avatar