Skip to content

Instantly share code, notes, and snippets.

@slobodin
Created October 10, 2018 20:35
Show Gist options
  • Save slobodin/7886457059457ff6e12f463feb205348 to your computer and use it in GitHub Desktop.
Save slobodin/7886457059457ff6e12f463feb205348 to your computer and use it in GitHub Desktop.
// Query all input devices.
// We do this so that we can see them in the log as they are enumerated.
int[] ids = mInputManager.getInputDeviceIds();
for (int id : ids) {
InputDeviceState state = getInputDeviceState(id);
if (state != null && deviceIsJoystick(state.getDevice()))
addJoystick(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment