Override controller type when motion sensor emulation is enabled

Without this, the host will still select an Xbox controller even if it can't support motion sensors.
This commit is contained in:
Cameron Gutman committed 2023-09-16 22:48:38 -05:00
1 parent 7d69b53958
commit cafc4450b2
2 files changed
+11 -1

No files matched your search

@@ -33,6 +33,7 @@ import android.view.Surface;
import android.widget.Toast;
import com.limelight.LimeLog;
import com.limelight.R;
import com.limelight.binding.input.driver.AbstractController;
import com.limelight.binding.input.driver.UsbDriverListener;
import com.limelight.binding.input.driver.UsbDriverService;
@@ -2906,6 +2907,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
capabilities |= MoonBridge.LI_CCAP_GYRO;
}
// Override the detected controller type if we're emulating motion sensors on an Xbox controller
if (type != MoonBridge.LI_CTYPE_PS && sensorManager != null) {
Toast.makeText(activityContext, activityContext.getResources().getText(R.string.toast_controller_type_changed), Toast.LENGTH_LONG).show();
type = MoonBridge.LI_CTYPE_UNKNOWN;
}
// We can perform basic rumble with any vibrator
if (vibrator != null) {
capabilities |= MoonBridge.LI_CCAP_RUMBLE;