@Override
    public boolean onKeyDown(int key) {
        super.onKeyDown(key);
        
        if(selected) {
            if(key == Keyboard.KEY_RETURN) {
                ConsoleFactory.get().processInput(currentInput);
                currentInput = "";
                return true;
            }
            else if(key == Keyboard.KEY_BACK && currentInput.length() > 0) {
                currentInput = currentInput.substring(0, currentInput.length()-1);
                return true;
            }
            else if(getChar(key) != INVALID_CHAR) {
                currentInput += getChar(key);
                return true;
            }
        }
        
        return false;
    }