Reputation: 23
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
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