@Override
                public void invoke(int jid, int event) {

                    // Invoke the disconnected event before we reload the joysticks or lose the reference to it.
                    // Invoke the connected event after we reload the joysticks to obtain the reference to it.

                    if ( event == GLFW.GLFW_CONNECTED ) {
                        joyInput.reloadJoysticks();
                        joyInput.fireJoystickConnectedEvent(jid);
                    }
                    else {
                        joyInput.fireJoystickDisconnectedEvent(jid);
                        joyInput.reloadJoysticks();
                    }
                }
Initializes the LWJGL renderer and input.
@param first - Whether this is the first time we are initializing and we
need to create the renderer or not. Otherwise, we'll just reset the
renderer as needed.
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java