why this doesn t work?
this is the code package controles; import java.awt.event.KeyListener; public final class teclado implements KeyListener{ private final static int numTeclas = 120; private final boolean[] teclas = new boolean[numTeclas]; public boolean arriba; public boolean abajo; public boolean izquierda; public boolean derecha; public void actualizar(){ arriba = teclas[KeyEvent.VK_W]; abajo = teclas[KeyEvent.VK_S]; izquierda = teclas[KeyEvent.VK_A]; derecha = teclas[KeyEvent.VK_D]; } public void KeyPressed(KeyEvent e){ teclas[e.getKeyCode()] = true; } public void KeyReleased(KeyEvent e){ teclas[e.getKeyCode()] = false; } public void KeyTyped(KeyEvent e){ } } the error is that keyevent does not recognize i don t know why