diff --git a/VoidLink/Input/OnScreenControls.h b/VoidLink/Input/OnScreenControls.h index e6e70075..c9cd2909 100644 --- a/VoidLink/Input/OnScreenControls.h +++ b/VoidLink/Input/OnScreenControls.h @@ -111,7 +111,6 @@ typedef NS_ENUM(NSInteger, OnScreenControlsLevel) { + (NSMutableSet* )touchAddrsCapturedByOnScreenControls; -+ (void) testMethod; - (void) sendRightStickTouchPadEvent:(CGFloat) stickX : (CGFloat) stickY; - (void) clearRightStickTouchPadFlag; - (void) sendLeftStickTouchPadEvent:(CGFloat) stickX : (CGFloat) stickY; diff --git a/VoidLink/Input/RelativeTouchHandler.h b/VoidLink/Input/RelativeTouchHandler.h index fa6eb776..d856d468 100644 --- a/VoidLink/Input/RelativeTouchHandler.h +++ b/VoidLink/Input/RelativeTouchHandler.h @@ -22,7 +22,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) CADisplayLink *displayLink; -+ (void) testMethod; - (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings; @end diff --git a/VoidLink/Input/RelativeTouchHandler.m b/VoidLink/Input/RelativeTouchHandler.m index acef4738..f8cde591 100644 --- a/VoidLink/Input/RelativeTouchHandler.m +++ b/VoidLink/Input/RelativeTouchHandler.m @@ -23,6 +23,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; CGPoint twoFingerTouchLocation; NSTimeInterval mousePointerTimestamp; CGRect streamViewBounds; + BOOL firstTouchMoved; BOOL mousePointerMoved; BOOL quickTapDetected; BOOL isInMouseWheelScrollingMode; @@ -57,6 +58,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; [self->streamView.streamFrameTopLayerView addGestureRecognizer:_mouseRightClickTapRecognizer]; // add all additional gestures to the streamFrameTopLayerView instead of the streamview. isInMouseWheelScrollingMode = false; + firstTouchMoved = false; mousePointerMoved = false; mousePointerTimestamp = 0; @@ -141,6 +143,7 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; return; } + firstTouchMoved = false; touchPointSpawnedAtUpperScreenEdge = false; // reset this flag immediately if we get a touch event passing the check above, this fixes irresponsive touch after closing the command tool menu. if([[event allTouches] count] == 2 && ![self isOnScreenWidgetViewBeingPressed] && ![self isOnScreenControllerBeingPressed:[event allTouches]]){ @@ -246,11 +249,16 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; CGPoint currentLocation = [touch locationInView:self->streamView]; + if (!self->firstTouchMoved) { + self->latestMousePointerLocation = currentLocation; + self->firstTouchMoved = true; + } + if (self->latestMousePointerLocation.x != currentLocation.x || self->latestMousePointerLocation.y != currentLocation.y) { - int deltaX = (currentLocation.x - self->latestMousePointerLocation.x) * (REFERENCE_WIDTH / self->streamViewBounds.size.width) * self->currentSettings.mousePointerVelocityFactor.floatValue; - int deltaY = (currentLocation.y - self->latestMousePointerLocation.y) * (REFERENCE_HEIGHT / self->streamViewBounds.size.height) * self->currentSettings.mousePointerVelocityFactor.floatValue; + int deltaX = (currentLocation.x - self->latestMousePointerLocation.x) * 1.35 * self->currentSettings.mousePointerVelocityFactor.floatValue; + int deltaY = (currentLocation.y - self->latestMousePointerLocation.y) * 1.35 * self->currentSettings.mousePointerVelocityFactor.floatValue; if (deltaX != 0 || deltaY != 0) { LiSendMouseMoveEvent(deltaX, deltaY);