I am working on developing an on-screen keyboard with java. This keyboard has a JComponent for every possible key. When a mouse down is detected on the button
JComponent
I found jnativehook when I was trying to control a gamebot with actual keyboard and mouse commands (to be more "human-like").