mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-01 23:35:59 +00:00
Disable system gestures on gamepad buttons while streaming
This commit is contained in:
parent
4079af5d22
commit
16acd71f6a
@ -225,6 +225,13 @@ static const double MOUSE_SPEED_DIVISOR = 2.5;
|
||||
controller.controllerPausedHandler = NULL;
|
||||
|
||||
if (controller.extendedGamepad != NULL) {
|
||||
// Re-enable system gestures on the gamepad buttons now
|
||||
if (@available(iOS 14.0, tvOS 14.0, *)) {
|
||||
for (GCControllerElement* element in controller.extendedGamepad.allElements) {
|
||||
element.preferredSystemGestureState = GCSystemGestureStateEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
controller.extendedGamepad.valueChangedHandler = NULL;
|
||||
}
|
||||
else if (controller.gamepad != NULL) {
|
||||
@ -281,6 +288,14 @@ static const double MOUSE_SPEED_DIVISOR = 2.5;
|
||||
}
|
||||
|
||||
if (controller.extendedGamepad != NULL) {
|
||||
// Disable system gestures on the gamepad to avoid interfering
|
||||
// with in-game controller actions
|
||||
if (@available(iOS 14.0, tvOS 14.0, *)) {
|
||||
for (GCControllerElement* element in controller.extendedGamepad.allElements) {
|
||||
element.preferredSystemGestureState = GCSystemGestureStateDisabled;
|
||||
}
|
||||
}
|
||||
|
||||
controller.extendedGamepad.valueChangedHandler = ^(GCExtendedGamepad *gamepad, GCControllerElement *element) {
|
||||
Controller* limeController = [self->_controllers objectForKey:[NSNumber numberWithInteger:gamepad.controller.playerIndex]];
|
||||
short leftStickX, leftStickY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user