From 00aff53e358e11499913c65231384a8e0f31468b Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Sun, 29 Jun 2025 19:45:46 +0800 Subject: [PATCH] iboutlet motionselector ipad --- Limelight/Base.lproj/iPad.storyboard | 19 ++++++++++--------- .../ViewControllers/SettingsViewController.m | 1 + VoidLink/Input/ControllerSupport.m | 5 +++++ .../ViewControllers/MainFrameViewController.m | 1 + 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Limelight/Base.lproj/iPad.storyboard b/Limelight/Base.lproj/iPad.storyboard index 5ee58d31..3f1909a9 100644 --- a/Limelight/Base.lproj/iPad.storyboard +++ b/Limelight/Base.lproj/iPad.storyboard @@ -1,9 +1,9 @@ - + - + @@ -12,7 +12,7 @@ - + @@ -641,6 +641,7 @@ ICAgICAgICAgICAgICA + @@ -683,7 +684,7 @@ ICAgICAgICAgICAgICA - + @@ -723,7 +724,7 @@ ICAgICAgICAgICAgICA - + @@ -745,7 +746,7 @@ ICAgICAgICAgICAgICA - + @@ -772,7 +773,7 @@ ICAgICAgICAgICAgICA - + @@ -990,11 +991,11 @@ ICAgICAgICAgICAgICA - + - + diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index 7017a841..29619993 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -1090,6 +1090,7 @@ BOOL isCustomResolution(CGSize res) { NSInteger resolutionSelected = [self.resolutionSelector selectedSegmentIndex]; NSInteger externalDisplayMode = [self.externalDisplayModeSelector selectedSegmentIndex]; NSInteger localMousePointerMode = [self.localMousePointerModeSelector selectedSegmentIndex]; + NSLog(@"saving motionMode: %ld", motionMode); [dataMan saveSettingsWithBitrate:_bitrate framerate:framerate height:height diff --git a/VoidLink/Input/ControllerSupport.m b/VoidLink/Input/ControllerSupport.m index bf90bf1b..c2e1ac9c 100644 --- a/VoidLink/Input/ControllerSupport.m +++ b/VoidLink/Input/ControllerSupport.m @@ -99,6 +99,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25; Controller* controller = [_controllers objectForKey:[NSNumber numberWithInteger:controllerNumber]]; #if !TARGET_OS_TV //tvOS has no device motion NSInteger motionMode = _motionMode; //motionMode 0 = auto | 1 = always device | 2 = always controller + NSLog(@"motionMode: %ld", (long)motionMode); if(motionMode !=2 && controllerNumber < 2){ if(controller == nil || controller.gamepad.motion == nil || motionMode == 1){ //Player has no controller *or* no motion for controller 1 *or* wants to override controller 1 motion with device motion @@ -136,6 +137,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25; controller.lastDeviceAccelSample = deviceAccelSample; // Convert g to m/s^2 + NSLog(@"gyro input no.1 %f", CACurrentMediaTime()); if(UIApplication.sharedApplication.windows.firstObject.windowScene.interfaceOrientation == 4){ //check for landscape left or landscape right LiSendControllerMotionEvent((uint8_t)controllerNumber, LI_MOTION_TYPE_ACCEL, @@ -175,6 +177,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25; controller.lastDeviceGyroSample = deviceGyroSample; // Convert rad/s to deg/s + NSLog(@"gyro input no.2 %f", CACurrentMediaTime()); if(UIApplication.sharedApplication.windows.firstObject.windowScene.interfaceOrientation == 4){//check for landscape left or landscape right LiSendControllerMotionEvent((uint8_t)controllerNumber, LI_MOTION_TYPE_GYRO, @@ -220,6 +223,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25; controller.lastAccelSample = accelSample; // Convert g to m/s^2 + NSLog(@"gyro input no.3 %f", CACurrentMediaTime()); LiSendControllerMotionEvent((uint8_t)controllerNumber, LI_MOTION_TYPE_ACCEL, accelSample.x * -9.80665f, @@ -250,6 +254,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25; controller.lastGyroSample = gyroSample; // Convert rad/s to deg/s + NSLog(@"gyro input no.4 %f", CACurrentMediaTime()); LiSendControllerMotionEvent((uint8_t)controllerNumber, LI_MOTION_TYPE_GYRO, gyroSample.x * 57.2957795f, diff --git a/VoidLink/ViewControllers/MainFrameViewController.m b/VoidLink/ViewControllers/MainFrameViewController.m index 900af2d2..0ba86f85 100644 --- a/VoidLink/ViewControllers/MainFrameViewController.m +++ b/VoidLink/ViewControllers/MainFrameViewController.m @@ -666,6 +666,7 @@ static NSMutableSet* hostList; _streamConfig.useFramePacing = streamSettings.useFramePacing; _streamConfig.swapABXYButtons = streamSettings.swapABXYButtons; _streamConfig.motionMode = [streamSettings.motionMode intValue]; + NSLog(@"motionMode from settings: %ld", _streamConfig.motionMode); _streamConfig.largerStickLR1 = streamSettings.largerStickLR1; // new streamConfig segment // multiController must be set before calling getConnectedGamepadMask