mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-04 06:56:06 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user