Skip to content

Commit

Permalink
Fixed Android joystick detection
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 19, 2017
1 parent 7293290 commit 2001898
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion android-project/src/org/libsdl/app/SDLControllerManager.java
Expand Up @@ -101,7 +101,9 @@ public static boolean isDeviceSDLJoystick(int deviceId) {
Log.v(TAG, "Input device " + device.getName() + " is a gamepad.");
}

return ((sources & (InputDevice.SOURCE_CLASS_JOYSTICK|InputDevice.SOURCE_GAMEPAD)) != 0);
return (((sources & InputDevice.SOURCE_CLASS_JOYSTICK) == InputDevice.SOURCE_CLASS_JOYSTICK) ||
((sources & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD)
);
}

}
Expand Down

0 comments on commit 2001898

Please sign in to comment.