I on the keyboard a lot more buttons, and I really need to listen t开发者_运维知识库o push the buttons (multimedia play, stop ..).
How do it?
And I would like to catch the event, even when the window is minimized.
Use this jintellitype to catch key events outside your app in Windows. Here is for linux JXGrabKey
Update: to use multimedia buttons, you need to know it's codes. Add this listener to your app's frame to find out codes:
class MyKeyListener extends KeyAdapter {
public void keyPressed(KeyEvent evt) {
System.out.println("Key code: " + evt.getKeyCode());
}
}
If you will know the code, just check if evt.getKeyCode() is what you need and make some actions.
精彩评论