4949 */
5050public class GlfwJoystickInput implements JoyInput {
5151
52- private static final Logger LOGGER = Logger .getLogger (InputManager .class .getName ());
52+ private static final Logger LOGGER = Logger .getLogger (GlfwJoystickInput .class .getName ());
5353
5454 private RawInputListener listener ;
5555
5656 private final Map <Integer , GlfwJoystick > joysticks = new HashMap <>();
5757
5858 private final Map <JoystickButton , Boolean > joyButtonPressed = new HashMap <>();
5959
60- private InputManager inputManager ;
60+ // private InputManager inputManager;
6161
6262 private boolean initialized = false ;
6363
@@ -68,24 +68,22 @@ public void setJoyRumble(final int joyId, final float amount) {
6868 }
6969 }
7070
71- public void fireJoystickConnectionEvent (int jid , int event ) {
72- inputManager .fireJoystickConnectionEvent (jid , event );
71+ public void fireJoystickConnectionEvent (int jid , JoystickState state ) {
72+ (( InputManager ) listener ) .fireJoystickConnectionEvent (jid , state );
7373 }
7474
7575 public void reloadJoysticks () {
7676 joysticks .clear ();
7777
78- if ( inputManager != null ) {
79- Joystick [] joysticks = loadJoysticks ( inputManager );
80- inputManager . setJoysticks ( joysticks );
81- }
78+ InputManager inputManager = ( InputManager ) listener ;
79+
80+ Joystick [] joysticks = loadJoysticks ( inputManager );
81+ inputManager . setJoysticks ( joysticks );
8282 }
8383
8484 @ Override
8585 public Joystick [] loadJoysticks (final InputManager inputManager ) {
8686
87- this .inputManager = inputManager ;
88-
8987 for (int i = 0 ; i < GLFW_JOYSTICK_LAST ; i ++) {
9088 if (glfwJoystickPresent (i )) {
9189 final String name = glfwGetJoystickName (i );
0 commit comments