erm...
"It occours in Linux but not in Windows..."
did u tryed that with the same keyboard?
alternativly u could simply try another way to handle inputs:
1 2 3 4 5 6 7 8 9 10 11
| implements KeyListener ... addKeyListener(this); ... public void keyPressed(KeyEvent ke) {controls[ke.getKeyCode()&0xFF] = 1;}
public void keyReleased(KeyEvent ke) {controls[ke.getKeyCode()&0xFF] = 0;}
public void keyTyped(KeyEvent ke){} |
goes to :-
1 2 3 4
| enableEvents(AWTEvent.KEY_EVENT_MASK); ... public void processKeyEvent(KeyEvent ke) {controls[ke.getKeyCode()&0xFF] = (ke.getID()==KeyEvent.KEY_RELEASED)?0:1 ;} |
that asumes, that u store the keystates in a int-array wich is capable to hold 256 values
int[] controls=new int[256];
btw the code snippets r from abuse
