public void keyPressed(KeyEvent e) {
        Screen3D screen = (Screen3D) e.getSource();

        switch (e.getKeyCode()) {
            case KeyEvent.VK_UP:
                screen.isUpPressed = true; 
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_DOWN:
                screen.isDownPressed = true; 
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_LEFT:
                screen.isLeftPressed = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_RIGHT:
                screen.isRightPressed = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_1:
                screen.isTurnLeftPressed = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_2:
                screen.isTurnRightPressed = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_Y:
                screen.isYawRightNeeded = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_P:
                screen.isRollUpNeeded = true;
                screen.isRepaintNeeded = true;
                break;
            case KeyEvent.VK_R:
                screen.isRollDownNeeded = true;
                screen.isRepaintNeeded = true;
                break;
        }
    }