public void keyPressed(KeyEvent e)
    {
        switch(e.getKeyCode())
        {
            case KeyEvent.VK_PLUS:      plus = true;
                                        break;
            case KeyEvent.VK_MINUS:     minus = true;
                                        break;
            case KeyEvent.VK_P:         p = true;
                                        break;
            case KeyEvent.VK_R:         r = true;
                                        break;
            case KeyEvent.VK_ESCAPE:    esc = true;
        }
    }