TEMP
Merge branch 'Moonlight-iOS-Official9.0.2' into Moonlight-iOS-ZWM2 * Moonlight-iOS-Official9.0.2: (29 commits) Update README.md Update README.md Update README.md Update README.md Update README.md Update README.md Update README.md Update README.md Update README.md Version 9.0.2 Update moonlight-common-c to resolve build warning Improve smooth scrolling precision mapped the Globe/Language key to Escape yes 0x0D is the correct code for Enter according to Microsoft's documentation Update moonlight-common-c with RTSP encryption and QoS improvements Remove xcpretty in CI Update AppVeyor images Remove CPU core count check Update moonlight-common-c with finalized encryption changes Opt in for video encryption on A10 and later SoCs ... # Conflicts: # Limelight/Input/StreamView.m # Moonlight-ZWM.xcodeproj/project.pbxproj
This commit is contained in:
@@ -323,6 +323,12 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
- (void)sendStylusEvent:(UITouch*)event {
|
||||
uint8_t type;
|
||||
|
||||
// Don't touch stylus events if the host doesn't support them. We want to pass
|
||||
// them as normal touches for legacy hosts that don't understand pen events.
|
||||
if (!(LiGetHostFeatureFlags() & LI_FF_PEN_TOUCH_EVENTS)) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
switch (event.phase) {
|
||||
case UITouchPhaseBegan:
|
||||
type = LI_TOUCH_EVENT_DOWN;
|
||||
@@ -337,17 +343,17 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
type = LI_TOUCH_EVENT_CANCEL;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return YES;
|
||||
}
|
||||
|
||||
CGPoint location = [self adjustCoordinatesForVideoArea:[event locationInView:self]];
|
||||
CGSize videoSize = [self getVideoAreaSize];
|
||||
|
||||
LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
||||
(event.force / event.maximumPossibleForce) / sin(event.altitudeAngle),
|
||||
0.0f, 0.0f,
|
||||
[self getRotationFromAzimuthAngle:[event azimuthAngleInView:self]],
|
||||
[self getTiltFromAltitudeAngle:event.altitudeAngle]);
|
||||
return LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
||||
(event.force / event.maximumPossibleForce) / sin(event.altitudeAngle),
|
||||
0.0f, 0.0f,
|
||||
[self getRotationFromAzimuthAngle:[event azimuthAngleInView:self]],
|
||||
[self getTiltFromAltitudeAngle:event.altitudeAngle]) != LI_ERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
- (void)sendStylusHoverEvent:(UIHoverGestureRecognizer*)gesture API_AVAILABLE(ios(13.0)) {
|
||||
@@ -425,8 +431,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
// }
|
||||
for (UITouch* touch in touches) {
|
||||
if (touch.type == UITouchTypePencil) {
|
||||
[self sendStylusEvent:touch];
|
||||
return;
|
||||
if ([self sendStylusEvent:touch]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
TemporarySettings* settings = [[[DataManager alloc] init] getSettings];
|
||||
if (settings.absoluteTouchMode) {
|
||||
@@ -607,8 +614,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
if (@available(iOS 13.4, *)) {
|
||||
for (UITouch* touch in touches) {
|
||||
if (touch.type == UITouchTypePencil) {
|
||||
[self sendStylusEvent:touch];
|
||||
return;
|
||||
if ([self sendStylusEvent:touch]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
TemporarySettings* settings = [[[DataManager alloc] init] getSettings];
|
||||
if (settings.absoluteTouchMode) {
|
||||
@@ -699,8 +707,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
if (@available(iOS 13.4, *)) {
|
||||
for (UITouch* touch in touches) {
|
||||
if (touch.type == UITouchTypePencil) {
|
||||
[self sendStylusEvent:touch];
|
||||
return;
|
||||
if ([self sendStylusEvent:touch]) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
TemporarySettings* settings = [[[DataManager alloc] init] getSettings];
|
||||
if (settings.absoluteTouchMode) {
|
||||
@@ -811,20 +820,21 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
||||
}
|
||||
|
||||
CGPoint currentScrollTranslation = [gesture translationInView:self];
|
||||
const short translationMultiplier = 120 * 20; // WHEEL_DELTA * 20
|
||||
|
||||
{
|
||||
short translationDeltaY = ((currentScrollTranslation.y - lastScrollTranslation.y) / self.bounds.size.height) * 120; // WHEEL_DELTA
|
||||
short translationDeltaY = ((currentScrollTranslation.y - lastScrollTranslation.y) / self.bounds.size.height) * translationMultiplier;
|
||||
if (translationDeltaY != 0) {
|
||||
LiSendHighResScrollEvent(translationDeltaY * 20);
|
||||
LiSendHighResScrollEvent(translationDeltaY);
|
||||
lastScrollTranslation = currentScrollTranslation;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
short translationDeltaX = ((currentScrollTranslation.x - lastScrollTranslation.x) / self.bounds.size.width) * 120; // WHEEL_DELTA
|
||||
short translationDeltaX = ((currentScrollTranslation.x - lastScrollTranslation.x) / self.bounds.size.width) * translationMultiplier;
|
||||
if (translationDeltaX != 0) {
|
||||
// Direction is reversed from vertical scrolling
|
||||
LiSendHighResHScrollEvent(-translationDeltaX * 20);
|
||||
LiSendHighResHScrollEvent(-translationDeltaX);
|
||||
lastScrollTranslation = currentScrollTranslation;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user