From dbca1bb4ce2df2b2b889aed1dfc2b8ab7e97ae92 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 16 Sep 2020 17:08:20 -0700 Subject: [PATCH] Remove Citrix X1 support in preparation for GCMouse integration --- .gitmodules | 3 -- Limelight/Input/StreamView.h | 5 +-- Limelight/Input/StreamView.m | 59 +------------------------ Limelight/Limelight-Info.plist | 4 -- Moonlight TV/Info.plist | 4 -- Moonlight TV/Settings.bundle/Root.plist | 10 ----- X1Kit | 1 - 7 files changed, 3 insertions(+), 83 deletions(-) delete mode 160000 X1Kit diff --git a/.gitmodules b/.gitmodules index f35bae7..11cd918 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "moonlight-common/moonlight-common-c"] path = moonlight-common/moonlight-common-c url = https://github.com/moonlight-stream/moonlight-common-c.git -[submodule "X1Kit"] - path = X1Kit - url = https://github.com/fizzyade/X1Kit.git diff --git a/Limelight/Input/StreamView.h b/Limelight/Input/StreamView.h index 60b4a03..98e82c2 100644 --- a/Limelight/Input/StreamView.h +++ b/Limelight/Input/StreamView.h @@ -8,7 +8,6 @@ #import "ControllerSupport.h" #import "OnScreenControls.h" -#import "Moonlight-Swift.h" #import "StreamConfiguration.h" @protocol EdgeDetectionDelegate @@ -25,9 +24,9 @@ @end #if TARGET_OS_TV -@interface StreamView : OSView +@interface StreamView : OSView #else -@interface StreamView : OSView +@interface StreamView : OSView #endif @property (nonatomic, retain) IBOutlet UITextField* keyInputField; diff --git a/Limelight/Input/StreamView.m b/Limelight/Input/StreamView.m index 96892dd..3026d36 100644 --- a/Limelight/Input/StreamView.m +++ b/Limelight/Input/StreamView.m @@ -12,8 +12,6 @@ #import "ControllerSupport.h" #import "KeyboardSupport.h" -static const double X1_MOUSE_SPEED_DIVISOR = 2.5; - static const int REFERENCE_WIDTH = 1280; static const int REFERENCE_HEIGHT = 720; @@ -33,8 +31,7 @@ static const int REFERENCE_HEIGHT = 720; float lastMouseX; float lastMouseY; - // Citrix X1 mouse support - X1Mouse* x1mouse; + // iOS 14 mouse support double accumulatedMouseDeltaX; double accumulatedMouseDeltaY; @@ -88,13 +85,6 @@ static const int REFERENCE_HEIGHT = 720; [self addGestureRecognizer:mouseWheelRecognizer]; } #endif - - x1mouse = [[X1Mouse alloc] init]; - x1mouse.delegate = self; - - if (settings.btMouseSupport) { - [x1mouse start]; - } } - (void)startInteractionTimer { @@ -662,51 +652,4 @@ static const int REFERENCE_HEIGHT = 720; return commands; } -- (void)connectedStateDidChangeWithIdentifier:(NSUUID * _Nonnull)identifier isConnected:(BOOL)isConnected { - NSLog(@"Citrix X1 mouse state change: %@ -> %s", - identifier, isConnected ? "connected" : "disconnected"); -} - -- (void)mouseDidMoveWithIdentifier:(NSUUID * _Nonnull)identifier deltaX:(int16_t)deltaX deltaY:(int16_t)deltaY { - accumulatedMouseDeltaX += deltaX / X1_MOUSE_SPEED_DIVISOR; - accumulatedMouseDeltaY += deltaY / X1_MOUSE_SPEED_DIVISOR; - - short shortX = (short)accumulatedMouseDeltaX; - short shortY = (short)accumulatedMouseDeltaY; - - if (shortX == 0 && shortY == 0) { - return; - } - - LiSendMouseMoveEvent(shortX, shortY); - - accumulatedMouseDeltaX -= shortX; - accumulatedMouseDeltaY -= shortY; -} - -- (int) buttonFromX1ButtonCode:(enum X1MouseButton)button { - switch (button) { - case X1MouseButtonLeft: - return BUTTON_LEFT; - case X1MouseButtonRight: - return BUTTON_RIGHT; - case X1MouseButtonMiddle: - return BUTTON_MIDDLE; - default: - return -1; - } -} - -- (void)mouseDownWithIdentifier:(NSUUID * _Nonnull)identifier button:(enum X1MouseButton)button { - LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, [self buttonFromX1ButtonCode:button]); -} - -- (void)mouseUpWithIdentifier:(NSUUID * _Nonnull)identifier button:(enum X1MouseButton)button { - LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, [self buttonFromX1ButtonCode:button]); -} - -- (void)wheelDidScrollWithIdentifier:(NSUUID * _Nonnull)identifier deltaZ:(int8_t)deltaZ { - LiSendScrollEvent(deltaZ); -} - @end diff --git a/Limelight/Limelight-Info.plist b/Limelight/Limelight-Info.plist index b1e04f6..02c903c 100644 --- a/Limelight/Limelight-Info.plist +++ b/Limelight/Limelight-Info.plist @@ -46,10 +46,6 @@ NSAllowsArbitraryLoads - NSBluetoothAlwaysUsageDescription - Bluetooth access allows Moonlight to connect to Citrix X1 mice. - NSBluetoothPeripheralUsageDescription - Bluetooth access allows Moonlight to connect to Citrix X1 mice. NSLocalNetworkUsageDescription Moonlight uses the local network to connect to your gaming PC for streaming. NSBonjourServices diff --git a/Moonlight TV/Info.plist b/Moonlight TV/Info.plist index 9959dc0..5f995ea 100644 --- a/Moonlight TV/Info.plist +++ b/Moonlight TV/Info.plist @@ -36,10 +36,6 @@ NSAllowsArbitraryLoads - NSBluetoothAlwaysUsageDescription - Bluetooth access allows Moonlight to connect to Citrix X1 mice. - NSBluetoothPeripheralUsageDescription - Bluetooth access allows Moonlight to connect to Citrix X1 mice. NSLocalNetworkUsageDescription Moonlight uses the local network to connect to your gaming PC for streaming. NSBonjourServices diff --git a/Moonlight TV/Settings.bundle/Root.plist b/Moonlight TV/Settings.bundle/Root.plist index d843929..1895973 100644 --- a/Moonlight TV/Settings.bundle/Root.plist +++ b/Moonlight TV/Settings.bundle/Root.plist @@ -144,16 +144,6 @@ DefaultValue - - Type - PSToggleSwitchSpecifier - Title - Citrix X1 Mouse Support - Key - btMouseSupport - DefaultValue - - diff --git a/X1Kit b/X1Kit deleted file mode 160000 index cf378b5..0000000 --- a/X1Kit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cf378b5b8ccc2a6a401ede6a90e134aac906fa46