night_angel90
night_angel90

Reputation:

Simulate Keys presses with java application

Can I simulate a key presses with a java application to make system hear them?

Upvotes: 0

Views: 692

Answers (2)

Anonymous
Anonymous

Reputation: 152

You can simulate keyboard presses with java by implementing KeyListener.

Upvotes: 0

lbalazscs
lbalazscs

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

Related Questions