user1056053
user1056053

Reputation: 23

Java - Key Events and Key Binds

Is it possible to bind a global key listener for a Java program?

Like windows key binds.

My objective is to when I am in a game, I could, for example, change my current music by pushing F2 or F3.

Upvotes: 0

Views: 468

Answers (1)

user314104
user314104

Reputation: 1538

See the answer for Java System-Wide Keyboard Shortcut. If you want it to apply globally (and not just when the container is minimized), then this should do it. If you want it only for when your container is minimized, then you can take that solution and see if your container is minimized (Frame.getState()).

Upvotes: 1

Related Questions