public void handleEvents() {

        for (Event event : renderWindow.pollEvents()) {
            switch (event.type) {
                case CLOSED:
                    renderWindow.close();
                    break;

                case LOST_FOCUS:
                    if (currentScreen instanceof GameScreen) {
                        currentScreen = new PauseMenuScreen((GameScreen) currentScreen);
                    }
                    break;

                case KEY_PRESSED:
                    KeyEvent keyEvent = event.asKeyEvent();
                    inputHandler.handleKeyInput(keyEvent);
                    break;

                case MOUSE_BUTTON_PRESSED:
                    MouseButtonEvent mouseButtonEvent = event.asMouseButtonEvent();
                    inputHandler.handleMouseClickInput(mouseButtonEvent);
                    break;

                case MOUSE_MOVED:
                    MouseEvent mouseEvent = event.asMouseEvent();
                    inputHandler.handleMouseMoveInput(mouseEvent);
                    break;

                default:
                    break;
            }
        }
    }