@Override
    public void keyPressed(KeyEvent e) {
        int key = e.getKeyCode();
        String newText;
        switch (key) {
            case KeyEvent.VK_ENTER:
                // Update TextFields
                textArea.append(">>> " + inputField.getText() + "\n");
                String command = inputField.getText();
                inputField.setText("");
                
                // Parse the command
                boolean didParseCommand = internalParser.parse(command);
                if (!didParseCommand) {
                    didParseCommand = parser.parse(command, this);
                }
                if (!didParseCommand) {
                    println("Command not recognized.  Type 'help' for a list of commands.");
                }
                
                // Update shellHistory
                shellHistory.push(command);
                shellHistory.resetPosition();
                
                break;
            case KeyEvent.VK_UP:
                if (shellHistory.isShowingCurrentCommand()) {
                    shellHistory.setCurrentCommand(inputField.getText());
                }
                newText = shellHistory.getPrev();
                if (newText != null) {
                    inputField.setText(newText);
                }
                break;
            case KeyEvent.VK_DOWN:
                newText = shellHistory.getNext();
                if (newText != null) {
                    inputField.setText(newText);
                }
                break;
        }
    }