private void initCallbacks() {
        final long window = context.getWindowHandle();

        try (MemoryStack stack = MemoryStack.stackPush()) {

            final IntBuffer width = stack.callocInt(1);
            final IntBuffer height = stack.callocInt(1);

            glfwGetWindowSize(window, width, height);

            width.get();
            currentHeight = height.get();
        }

        initCurrentMousePosition(window);
        glfwSetCursorPosCallback(window, cursorPosCallback = new GLFWCursorPosCallback() {
            @Override
            public void invoke(final long window, final double xpos, final double ypos) {
                onCursorPos(window, xpos, ypos);
            }
        });

        glfwSetScrollCallback(window, scrollCallback = new GLFWScrollCallback() {
            @Override
            public void invoke(final long window, final double xOffset, final double yOffset) {
                onWheelScroll(window, xOffset, yOffset * WHEEL_SCALE);
            }
        });

        glfwSetMouseButtonCallback(window, mouseButtonCallback = new GLFWMouseButtonCallback() {
            @Override
            public void invoke(final long window, final int button, final int action, final int mods) {
                onMouseButton(window, button, action, mods);
            }
        });

        context.registerWindowSizeListener(windowSizeListener = ((width, height) -> {
            currentHeight = height;
        }));
    }
Re-initializes the mouse input context window specific callbacks
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java