P
patrick
I want to have a java application respond to keytype events.e.g. press z and
the application executes a z() method. But I want it to respond even if the
frame is minimized or does not have the focus. It is a swing application.
I have not succeeded in this with either addKeyListener() or with
AWTEventListener.
tia
patrick
getToolkit().addAWTEventListener(
new AWTEventListener() {
public void eventDispatched(AWTEvent e) {
//do something here
}
},
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.FOCUS_EVENT_MASK
);
the application executes a z() method. But I want it to respond even if the
frame is minimized or does not have the focus. It is a swing application.
I have not succeeded in this with either addKeyListener() or with
AWTEventListener.
tia
patrick
getToolkit().addAWTEventListener(
new AWTEventListener() {
public void eventDispatched(AWTEvent e) {
//do something here
}
},
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.FOCUS_EVENT_MASK
);