public void keyPressed(int key)
{
switch(getGameAction(key))
{
case RIGHT: right=true; break;
case LEFT: left=true; break;
case DOWN: down=true; break;
case UP: up=true; break;
}
}
...
public void keyReleased(int key)
{
switch(getGameAction(key))
{
case RIGHT: right=false; break;
case LEFT: left=false; break;
case DOWN: down=false; break;
case UP: up=false; break;
}
}