Hi
As Herkules noticed in my game (Castle Trouble) some days ago, my library has problems with catching keyboard events with VM 1.4.2.
At that time I was using J2SE 1.4.1_02 and all was OK, but now (only in Applet mode) with 1.4.2 sometime key events (key pressed or released) come after a while…
This is a piece of the Input class:
public class Input implements KeyListener,MouseListener,MouseMotionListener {
...
public void keyPressed(KeyEvent e){
changeKeyboardState(e,true);
System.out.println("KEY Pressed: "+e.getKeyCode());
}
public void keyReleased(KeyEvent e){
changeKeyboardState(e,false);
System.out.println("KEY Released: "+e.getKeyCode());
}
public void keyTyped(KeyEvent e){
}
...
}
As you can notice the same class intercepts Events from keyboard and mouse (maybe is this the problem?).
With J2SE 1.4.2 key events simply arrive late (the same time the relative string is printed out)…
Someone else have noticed this mulfunction of KeyListener Class?