mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-15 21:21:45 +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 "KeyboardSupport.h"
|
||||||
#import "TextFieldKeyboardDelegate.h"
|
#import "TextFieldKeyboardDelegate.h"
|
||||||
|
|
||||||
|
static const double X1_MOUSE_SPEED_DIVISOR = 2.0;
|
||||||
|
|
||||||
@implementation StreamView {
|
@implementation StreamView {
|
||||||
CGPoint touchLocation, originalLocation;
|
CGPoint touchLocation, originalLocation;
|
||||||
BOOL touchMoved;
|
BOOL touchMoved;
|
||||||
@@ -27,6 +29,9 @@
|
|||||||
float yDeltaFactor;
|
float yDeltaFactor;
|
||||||
float screenFactor;
|
float screenFactor;
|
||||||
|
|
||||||
|
double mouseX;
|
||||||
|
double mouseY;
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
UIGestureRecognizer* remotePressRecognizer;
|
UIGestureRecognizer* remotePressRecognizer;
|
||||||
UIGestureRecognizer* remoteLongPressRecognizer;
|
UIGestureRecognizer* remoteLongPressRecognizer;
|
||||||
@@ -374,7 +379,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseDidMoveWithIdentifier:(NSUUID * _Nonnull)identifier deltaX:(int16_t)deltaX deltaY:(int16_t)deltaY {
|
- (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 {
|
- (int) buttonFromX1ButtonCode:(enum X1MouseButton)button {
|
||||||
|
|||||||
Reference in New Issue
Block a user