Remove Citrix X1 support in preparation for GCMouse integration

This commit is contained in:
Cameron Gutman
2020-09-16 17:08:20 -07:00
parent dfec190b82
commit dbca1bb4ce
7 changed files with 3 additions and 83 deletions

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "moonlight-common/moonlight-common-c"] [submodule "moonlight-common/moonlight-common-c"]
path = moonlight-common/moonlight-common-c path = moonlight-common/moonlight-common-c
url = https://github.com/moonlight-stream/moonlight-common-c.git url = https://github.com/moonlight-stream/moonlight-common-c.git
[submodule "X1Kit"]
path = X1Kit
url = https://github.com/fizzyade/X1Kit.git

View File

@@ -8,7 +8,6 @@
#import "ControllerSupport.h" #import "ControllerSupport.h"
#import "OnScreenControls.h" #import "OnScreenControls.h"
#import "Moonlight-Swift.h"
#import "StreamConfiguration.h" #import "StreamConfiguration.h"
@protocol EdgeDetectionDelegate <NSObject> @protocol EdgeDetectionDelegate <NSObject>
@@ -25,9 +24,9 @@
@end @end
#if TARGET_OS_TV #if TARGET_OS_TV
@interface StreamView : OSView <X1KitMouseDelegate, UITextFieldDelegate> @interface StreamView : OSView <UITextFieldDelegate>
#else #else
@interface StreamView : OSView <X1KitMouseDelegate, UITextFieldDelegate, UIPointerInteractionDelegate> @interface StreamView : OSView <UITextFieldDelegate, UIPointerInteractionDelegate>
#endif #endif
@property (nonatomic, retain) IBOutlet UITextField* keyInputField; @property (nonatomic, retain) IBOutlet UITextField* keyInputField;

View File

@@ -12,8 +12,6 @@
#import "ControllerSupport.h" #import "ControllerSupport.h"
#import "KeyboardSupport.h" #import "KeyboardSupport.h"
static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
static const int REFERENCE_WIDTH = 1280; static const int REFERENCE_WIDTH = 1280;
static const int REFERENCE_HEIGHT = 720; static const int REFERENCE_HEIGHT = 720;
@@ -33,8 +31,7 @@ static const int REFERENCE_HEIGHT = 720;
float lastMouseX; float lastMouseX;
float lastMouseY; float lastMouseY;
// Citrix X1 mouse support // iOS 14 mouse support
X1Mouse* x1mouse;
double accumulatedMouseDeltaX; double accumulatedMouseDeltaX;
double accumulatedMouseDeltaY; double accumulatedMouseDeltaY;
@@ -88,13 +85,6 @@ static const int REFERENCE_HEIGHT = 720;
[self addGestureRecognizer:mouseWheelRecognizer]; [self addGestureRecognizer:mouseWheelRecognizer];
} }
#endif #endif
x1mouse = [[X1Mouse alloc] init];
x1mouse.delegate = self;
if (settings.btMouseSupport) {
[x1mouse start];
}
} }
- (void)startInteractionTimer { - (void)startInteractionTimer {
@@ -662,51 +652,4 @@ static const int REFERENCE_HEIGHT = 720;
return commands; 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 @end

View File

@@ -46,10 +46,6 @@
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Bluetooth access allows Moonlight to connect to Citrix X1 mice.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Bluetooth access allows Moonlight to connect to Citrix X1 mice.</string>
<key>NSLocalNetworkUsageDescription</key> <key>NSLocalNetworkUsageDescription</key>
<string>Moonlight uses the local network to connect to your gaming PC for streaming.</string> <string>Moonlight uses the local network to connect to your gaming PC for streaming.</string>
<key>NSBonjourServices</key> <key>NSBonjourServices</key>

View File

@@ -36,10 +36,6 @@
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Bluetooth access allows Moonlight to connect to Citrix X1 mice.</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Bluetooth access allows Moonlight to connect to Citrix X1 mice.</string>
<key>NSLocalNetworkUsageDescription</key> <key>NSLocalNetworkUsageDescription</key>
<string>Moonlight uses the local network to connect to your gaming PC for streaming.</string> <string>Moonlight uses the local network to connect to your gaming PC for streaming.</string>
<key>NSBonjourServices</key> <key>NSBonjourServices</key>

View File

@@ -144,16 +144,6 @@
<key>DefaultValue</key> <key>DefaultValue</key>
<true/> <true/>
</dict> </dict>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Citrix X1 Mouse Support</string>
<key>Key</key>
<string>btMouseSupport</string>
<key>DefaultValue</key>
<false/>
</dict>
</array> </array>
</dict> </dict>
</plist> </plist>

1
X1Kit

Submodule X1Kit deleted from cf378b5b8c