Reputation:
Can I simulate a key presses with a java application to make system hear them?
Upvotes: 0
Views: 692
Reputation: 152
You can simulate keyboard presses with java by implementing KeyListener.
Upvotes: 0
Reputation: 17784
You can simulate keyboard presses with Java (using the AWT Robot class) but you can listen to key events only if you have a GUI in focus (or if you interact with native C code, but that would be pretty complicated)
For global hotkeys, it would be very easy to do it using AutoHotkey instead of Java, as MBraedley suggested.
Upvotes: 1