public void keyPressed(KeyEvent e)
    {
        //System.out.println("Key = " + e.getKeyChar() + " = " + e.getKeyCode());
        
        key = e.getKeyCode();
        
        if (key == 32)
            space = true;
        else if (key == 38)
            up = true;
        else if (key == 37)
            left = true;
        else if (key == 39)
            right = true;
        else if (key == 40)
            down = true;
        else if (key == 10)
            enter = true;
        else if (key == 27)
            esc = true;

    }