mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-02-16 10:31:07 +00:00
Pass-through back button on external devices that don't look like gamepads
This commit is contained in:
@@ -380,9 +380,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
|
||||
// Classify this device as a remote by name if it has no joystick axes
|
||||
if (getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_X) == null &&
|
||||
getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_Y) == null &&
|
||||
devName.toLowerCase().contains("remote")) {
|
||||
if (!hasJoystickAxes(dev) && devName.toLowerCase().contains("remote")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -424,8 +422,11 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// c) have an internal gamepad but no internal select button (NVIDIA SHIELD Portable)
|
||||
return !foundInternalGamepad || foundInternalSelect;
|
||||
}
|
||||
|
||||
return false;
|
||||
else {
|
||||
// For external devices, we want to pass through the back button if the device
|
||||
// has no gamepad axes or gamepad buttons.
|
||||
return !hasJoystickAxes(dev) && !hasGamepadButtons(dev);
|
||||
}
|
||||
}
|
||||
|
||||
private InputDeviceContext createInputDeviceContextForDevice(InputDevice dev) {
|
||||
|
||||
Reference in New Issue
Block a user