mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-02-16 10:31:02 +00:00
Remove Citrix X1 support in preparation for GCMouse integration
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
|
||||
#import "ControllerSupport.h"
|
||||
#import "OnScreenControls.h"
|
||||
#import "Moonlight-Swift.h"
|
||||
#import "StreamConfiguration.h"
|
||||
|
||||
@protocol EdgeDetectionDelegate <NSObject>
|
||||
@@ -25,9 +24,9 @@
|
||||
@end
|
||||
|
||||
#if TARGET_OS_TV
|
||||
@interface StreamView : OSView <X1KitMouseDelegate, UITextFieldDelegate>
|
||||
@interface StreamView : OSView <UITextFieldDelegate>
|
||||
#else
|
||||
@interface StreamView : OSView <X1KitMouseDelegate, UITextFieldDelegate, UIPointerInteractionDelegate>
|
||||
@interface StreamView : OSView <UITextFieldDelegate, UIPointerInteractionDelegate>
|
||||
#endif
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UITextField* keyInputField;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -46,10 +46,6 @@
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</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>
|
||||
<string>Moonlight uses the local network to connect to your gaming PC for streaming.</string>
|
||||
<key>NSBonjourServices</key>
|
||||
|
||||
Reference in New Issue
Block a user