mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-03 00:06:31 +00:00
Restore GCMouse scroll handling for tvOS
This commit is contained in:
parent
76ef2ed432
commit
c99ee24c65
@ -432,6 +432,24 @@ static const double MOUSE_SPEED_DIVISOR = 2.5;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// We use UIPanGestureRecognizer on iPadOS because it allows us to distinguish
|
||||
// between discrete and continuous scroll events and also works around a bug
|
||||
// in iPadOS 15 where discrete scroll events are dropped. tvOS only supports
|
||||
// GCMouse for mice, so we will have to just use it and hope for the best.
|
||||
#if TARGET_OS_TV
|
||||
mouse.mouseInput.scroll.yAxis.valueChangedHandler = ^(GCControllerAxisInput * _Nonnull axis, float value) {
|
||||
self->accumulatedScrollY += -value;
|
||||
|
||||
short truncatedScrollY = (short)self->accumulatedScrollY;
|
||||
|
||||
if (truncatedScrollY != 0) {
|
||||
LiSendHighResScrollEvent(truncatedScrollY);
|
||||
|
||||
self->accumulatedScrollY -= truncatedScrollY;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
-(void) updateAutoOnScreenControlMode
|
||||
|
Loading…
x
Reference in New Issue
Block a user