Quote:
Originally Posted by RyanCahoon
In JInput, the comment for net.java.games.input.Controller. poll() says:
Code:
/**
* Polls axes for data. Returns false if the controller is no longer valid.
In LWJGL's GLFW library, there's
Code:
bool present = org.lwjgl.glfw.GLFW.glfwJoystickPresent(GLFW_JOYSTICK_1) == org.lwjgl.opengl.GL11.GL_TRUE;
|
[/quote]
Weird. I tried that in LWJGL, but it didn't work. I assumed it wouldn't work in JInput, but looks like it does.
LWJGL's docs
How would you check if the controller has reconnected? Would the .poll work again?
What if you connected a new joystick? How would you rebuild the list attached gamepads, if, say, you started the program and then connected a controller? IIRC, both JInput and LWJGL only build the list the first time you call it, and will give you only that list from that point on.