From c6785e3728941dacf2b78bf42211f6a635d4a1a1 Mon Sep 17 00:00:00 2001 From: True Zhuanjia Date: Mon, 17 Jun 2024 01:10:15 +0800 Subject: [PATCH] minor improvement --- Limelight/Input/NativeTouchHandler.m | 44 +++++-------------- .../Moonlight v1.10.xcdatamodel/contents | 2 +- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/Limelight/Input/NativeTouchHandler.m b/Limelight/Input/NativeTouchHandler.m index 3b831cce..5df2044f 100644 --- a/Limelight/Input/NativeTouchHandler.m +++ b/Limelight/Input/NativeTouchHandler.m @@ -36,18 +36,6 @@ } -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - -#if !TARGET_OS_TV - if (@available(iOS 13.4, *)) { - for (UITouch* touch in touches) [self handleUITouch:touch index:0];// Native touch (absoluteTouch) first! - return; - } -#endif - } - - - - (void)sendTouchEvent:(UITouch*)event touchType:(uint8_t)touchType{ CGPoint targetCoords; if(activateCoordSelector && event.phase == UITouchPhaseMoved) targetCoords = [NativeTouchPointer selectCoordsFor:event]; // coordinates of touch pointer replaced to relative ones here. @@ -113,38 +101,26 @@ [self sendTouchEvent:event touchType:type]; } +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + for (UITouch* touch in touches) [self handleUITouch:touch index:0]; + return; + } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { -#if !TARGET_OS_TV - if (@available(iOS 13.4, *)) { - for (UITouch* touch in touches) [self handleUITouch:touch index:0];// Native touch (absoluteTouch) first! - return; - // NSLog(@"touchesMoved - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]); - } -#endif + for (UITouch* touch in touches) [self handleUITouch:touch index:0]; + return; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { -#if !TARGET_OS_TV - if (@available(iOS 13.4, *)) { - for (UITouch* touch in touches) [self handleUITouch:touch index:0];// Native touch (absoluteTouch) first! - return; - // NSLog(@"touchesEnded - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]); - } -#endif + for (UITouch* touch in touches) [self handleUITouch:touch index:0]; + return; } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { -#if !TARGET_OS_TV - if (@available(iOS 13.4, *)) { - for (UITouch* touch in touches) [self handleUITouch:touch index:0];// Native touch (absoluteTouch) first! - return; - } - // NSLog(@"touchesCancelled - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]); -#endif + for (UITouch* touch in touches) [self handleUITouch:touch index:0];// Native touch (absoluteTouch) first! + return; } - @end diff --git a/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents b/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents index 8847f518..e413b212 100644 --- a/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents +++ b/Limelight/Limelight.xcdatamodeld/Moonlight v1.10.xcdatamodel/contents @@ -34,7 +34,7 @@ - +