@Override
    public void setCursorVisible(boolean visible) {
        cursorVisible = visible;

        if (!context.isRenderable()) {
            return;
        }

        if (cursorVisible) {
            glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
        } else {
            glfwSetInputMode(context.getWindowHandle(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
        }
    }
Send the input listener a special mouse-motion event with zero deltas in
order to initialize the listener's cursor position.
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java