mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-02-16 10:31:02 +00:00
Slow X1 mouse input by 2x to make it more usable
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
#import "KeyboardSupport.h"
|
||||
#import "TextFieldKeyboardDelegate.h"
|
||||
|
||||
static const double X1_MOUSE_SPEED_DIVISOR = 2.0;
|
||||
|
||||
@implementation StreamView {
|
||||
CGPoint touchLocation, originalLocation;
|
||||
BOOL touchMoved;
|
||||
@@ -27,6 +29,9 @@
|
||||
float yDeltaFactor;
|
||||
float screenFactor;
|
||||
|
||||
double mouseX;
|
||||
double mouseY;
|
||||
|
||||
#if TARGET_OS_TV
|
||||
UIGestureRecognizer* remotePressRecognizer;
|
||||
UIGestureRecognizer* remoteLongPressRecognizer;
|
||||
@@ -374,7 +379,20 @@
|
||||
}
|
||||
|
||||
- (void)mouseDidMoveWithIdentifier:(NSUUID * _Nonnull)identifier deltaX:(int16_t)deltaX deltaY:(int16_t)deltaY {
|
||||
LiSendMouseMoveEvent(deltaX, deltaY);
|
||||
mouseX += deltaX / X1_MOUSE_SPEED_DIVISOR;
|
||||
mouseY += deltaY / X1_MOUSE_SPEED_DIVISOR;
|
||||
|
||||
short shortX = (short)mouseX;
|
||||
short shortY = (short)mouseY;
|
||||
|
||||
if (shortX == 0 && shortY == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
LiSendMouseMoveEvent(shortX, shortY);
|
||||
|
||||
mouseX -= shortX;
|
||||
mouseY -= shortY;
|
||||
}
|
||||
|
||||
- (int) buttonFromX1ButtonCode:(enum X1MouseButton)button {
|
||||
|
||||
Reference in New Issue
Block a user