diff --git a/VoidLink/Input/AbsoluteTouchHandler.m b/VoidLink/Input/AbsoluteTouchHandler.m index a398932e..94cc128e 100644 --- a/VoidLink/Input/AbsoluteTouchHandler.m +++ b/VoidLink/Input/AbsoluteTouchHandler.m @@ -89,8 +89,8 @@ - (void)onLongPressStart:(NSTimer*)timer { // Raise the left click and start a right click - if(currentTouchesCount>=2) return; - + if(multiTouchesDetected) return; + if([self touchDidntMoveOnScreen:movingTouchLocation]){ if(_delayMouseLeftClick){ LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT); @@ -109,8 +109,11 @@ rightButtonClicked = false; - if([UITouchUtil touchesIn:streamView from:event].count>=2) multiTouchesDetected = true; - + if([UITouchUtil touchesIn:streamView from:event].count>=2){ + multiTouchesDetected = true; + [longPressTimer invalidate]; + longPressTimer = nil; + } CGPoint initialPoint = [[touches anyObject] locationInView:streamView]; if(initialPoint.y < slideGestureVerticalThreshold && (initialPoint.x < _edgeTolerance || initialPoint.x > screenWidthWithThreshold)) { @@ -209,11 +212,13 @@ } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + [longPressTimer invalidate]; + longPressTimer = nil; if(TouchPadGestureHandler.ctrlDown) LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[@"CTRL"].shortValue,KEY_ACTION_UP,0); if(touchPointSpawnedAtUpperScreenEdge) return; // we're done here. this touch event will not be sent to the remote PC. - + if(multiTouchesDetected) { if([UITouchUtil touchesIn:streamView from:event].count == touches.count) multiTouchesDetected = false; return; diff --git a/VoidLink/Input/RelativeTouchHandler.h b/VoidLink/Input/RelativeTouchHandler.h index a23cb415..c52da0b9 100644 --- a/VoidLink/Input/RelativeTouchHandler.h +++ b/VoidLink/Input/RelativeTouchHandler.h @@ -13,7 +13,7 @@ #import "DataManager.h" #import "CustomTapGestureRecognizer.h" -#define RIGHTCLICK_TAP_DOWN_TIME_THRESHOLD_S 0.15 +#define RIGHTCLICK_TAP_DOWN_TIME_THRESHOLD_S 0.1 NS_ASSUME_NONNULL_BEGIN diff --git a/VoidLink/Input/RelativeTouchHandler.m b/VoidLink/Input/RelativeTouchHandler.m index b142daf9..f3c991df 100644 --- a/VoidLink/Input/RelativeTouchHandler.m +++ b/VoidLink/Input/RelativeTouchHandler.m @@ -193,10 +193,6 @@ static const float QUICK_TAP_TIME_INTERVAL = 0.2; if(TouchPadGestureHandler.ctrlDown) LiSendKeyboardEvent(CommandManager.keyboardButtonMappings[@"CTRL"].shortValue,KEY_ACTION_UP,0); - NSLog(@"testtttttt %lu, %lu, %f",[UITouchUtil touchesIn:streamView from:event].count, touches.count, CACurrentMediaTime()); - NSLog(@"testtttttt666 %lu, %lu, %f",[event allTouches].count, touches.count, CACurrentMediaTime()); - - if(multiTouchesDetected){ if([UITouchUtil touchesIn:streamView from:event].count == touches.count){ diff --git a/VoidLink/ViewControllers/MainFrameViewController.m b/VoidLink/ViewControllers/MainFrameViewController.m index a315876b..e1e87060 100644 --- a/VoidLink/ViewControllers/MainFrameViewController.m +++ b/VoidLink/ViewControllers/MainFrameViewController.m @@ -1169,7 +1169,8 @@ static NSMutableSet* hostList; // [settingsViewController widget:settingsViewController.bitrateSlider setEnabled:!self.settingsExpandedInStreamView]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.optimizeGamesStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioOnPcStack]; - [settingsViewController.touchModeSelector1 setEnabled:!_settingsExpandedInStreamView || !_sessionLaunchedWithAbsoluteTouch]; + [settingsViewController.touchModeSelector1 setEnabled:!_settingsExpandedInStreamView || !(settingsViewController.touchModeSelector1.selectedSegmentIndex == AbsoluteTouch && !settingsViewController.passthroughGesturesSwitch.isOn)]; + [settingsViewController.touchModeSelector2 setEnabled:settingsViewController.touchModeSelector1.enabled]; [settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView]; [settingsViewController.yuv444Switch setEnabled:!_settingsExpandedInStreamView]; [settingsViewController.hdrSwitch setEnabled:!_settingsExpandedInStreamView && [settingsViewController hdrSupported]]; @@ -1190,6 +1191,7 @@ static NSMutableSet* hostList; if(_settingsExpandedInStreamView && !streamFrameViewController.micStreamInitialized) [settingsViewController.redirectMicSwitch setOn:false]; [settingsViewController setHidden:!settingsViewController.redirectMicSwitch.isOn forStack:settingsViewController.useBuiltinMicStack]; [settingsViewController.useBuiltinMicSwitch setEnabled:!_settingsExpandedInStreamView]; + [settingsViewController.passthroughGesturesSwitch setEnabled:!_settingsExpandedInStreamView]; } - (void)revealController:(SWRevealViewController *)revealController didMoveToPosition:(FrontViewPosition)position { diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index 332269b7..055e3823 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -457,15 +457,15 @@ BOOL isCustomResolution(int resolutionSelected) { [self updateResolutionTable]; - _scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, tempSettings.settingsMenuOffset.floatValue); + // _scrollView.contentOffset = CGPointMake(_scrollView.contentOffset.x, tempSettings.settingsMenuOffset.floatValue); + /// cancel restoring contentOffset [self.customResolutionSwitch addTarget:self action:@selector(customResolutionSwitched:) forControlEvents:UIControlEventValueChanged]; - - //CGSize currentResolution = CGSizeMake(currentSettings.width.intValue, currentSettings.height.intValue); [self.customResolutionSwitch setOn: isCustomResolution(self->tempSettings.resolutionSelected.intValue)]; [self.resolutionSelector setEnabled:!self.customResolutionSwitch.isOn]; + [self touchModeChanged:self.touchModeSelector1]; // a special fix for iOS 14 to set hidden for the "enableOswStack" - + settingsViewJustExpanded = false; } @@ -1917,7 +1917,7 @@ BOOL isCustomResolution(int resolutionSelected) { [self touchModeChanged:self.touchModeSelector1]; [self.touchModeSelector2 addTarget:self action:@selector(touchMode2Changed:) forControlEvents:UIControlEventValueChanged]; - + self.touchModeSelector2.selectedSegmentIndex = self.touchModeSelector1.selectedSegmentIndex; // self.enableOswSwitchStack.hidden = !(self->tempSettings.touchMode.intValue == NativeTouch || self->tempSettings.touchMode.intValue == NativeTouchOnly); // do not use setHidden to stack wrapped by a settingStack diff --git a/VoidLink/ViewControllers/StreamFrameViewController.m b/VoidLink/ViewControllers/StreamFrameViewController.m index 6373dba3..232f0482 100644 --- a/VoidLink/ViewControllers/StreamFrameViewController.m +++ b/VoidLink/ViewControllers/StreamFrameViewController.m @@ -311,7 +311,7 @@ } - (void)configZoomGestureAndAddStreamView{ - if (_settings.touchMode.intValue == AbsoluteTouch) { + if (_settings.touchMode.intValue == AbsoluteTouch && !_settings.passthroughGestures) { if(!_scrollView) _scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame]; #if !TARGET_OS_TV [_scrollView.panGestureRecognizer setMinimumNumberOfTouches:2];