deprecate NativeTouchOnly mode

This commit is contained in:
True Zhuanjia committed 2026-05-26 16:17:52 +08:00
1 parent c4ddc0c4fc
commit ffe48a5382
4 files changed
+18 -19

No files matched your search

+2
View File
@@ -125,6 +125,8 @@
self.controllerGyroSwitchToggle = [decoder containsValueForKey:@"controllerGyroSwitchToggle"] ? [decoder decodeIntForKey:@"controllerGyroSwitchToggle"] : ControllerButtonNull; self.controllerGyroSwitchToggle = [decoder containsValueForKey:@"controllerGyroSwitchToggle"] ? [decoder decodeIntForKey:@"controllerGyroSwitchToggle"] : ControllerButtonNull;
self.touchMode = [decoder containsValueForKey:@"touchMode"] ? [decoder decodeIntForKey:@"touchMode"] : NativeTouch; self.touchMode = [decoder containsValueForKey:@"touchMode"] ? [decoder decodeIntForKey:@"touchMode"] : NativeTouch;
if(self.touchMode == NativeTouchOnly) self.touchMode = NativeTouch;
self.pointerVelocityModeDivider = [decoder containsValueForKey:@"pointerVelocityModeDivider"] ? [decoder decodeFloatForKey:@"pointerVelocityModeDivider"] : 0.5; self.pointerVelocityModeDivider = [decoder containsValueForKey:@"pointerVelocityModeDivider"] ? [decoder decodeFloatForKey:@"pointerVelocityModeDivider"] : 0.5;
self.touchPointerVelocityFactor = [decoder containsValueForKey:@"touchPointerVelocityFactor"] ? [decoder decodeFloatForKey:@"touchPointerVelocityFactor"] : 1.0; self.touchPointerVelocityFactor = [decoder containsValueForKey:@"touchPointerVelocityFactor"] ? [decoder decodeFloatForKey:@"touchPointerVelocityFactor"] : 1.0;
+9 -15
View File
@@ -562,15 +562,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
#endif #endif
} }
// we'll enable on screen buttons, and disable on screen controllers for absolute touch
- (bool) isOscEnabled{
return (touchMode == RelativeTouch || touchMode == NativeTouch || touchMode == AbsoluteTouch || touchMode == TouchDisabled) && settings.onscreenControls.intValue != OnScreenControlsLevelOff;
}
// we'll enable on screen buttons, and disable on screen controllers for absolute touch // we'll enable on screen buttons, and disable on screen controllers for absolute touch
- (bool) isOnScreenWidgetEnabled{ - (bool) isOnScreenWidgetEnabled{
return [self isOscEnabled] && settings.onscreenControls.intValue == OnScreenControlsLevelCustom; return settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
} }
- (void) reloadOnScreenControlsRealtimeWithControllerSupport:(ControllerSupport*)controllerSupport - (void) reloadOnScreenControlsRealtimeWithControllerSupport:(ControllerSupport*)controllerSupport
@@ -594,7 +588,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
RelativeTouchHandler* relativeTouchHandler = (RelativeTouchHandler *)touchHandler; RelativeTouchHandler* relativeTouchHandler = (RelativeTouchHandler *)touchHandler;
onScreenControls.mouseRightClickTapRecognizer = relativeTouchHandler.mouseRightClickTapRecognizer; onScreenControls.mouseRightClickTapRecognizer = relativeTouchHandler.mouseRightClickTapRecognizer;
} */ } */
if([self isOscEnabled]) [_onScreenControls setLevel:(OnScreenControlsLevel)settings.onscreenControls.intValue]; if([self isOnScreenWidgetEnabled]) [_onScreenControls setLevel:(OnScreenControlsLevel)settings.onscreenControls.intValue];
} }
@@ -826,7 +820,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
NSLog(@"hasLegacyWidget %d %f", hasLegacyWidget, CACurrentMediaTime()); NSLog(@"hasLegacyWidget %d %f", hasLegacyWidget, CACurrentMediaTime());
// legacy widgets // legacy widgets
if(!OnScreenWidgetView.editMode && (hasLegacyWidget || !reloadWidgets)){ if(!OnScreenWidgetView.editMode && (hasLegacyWidget || !reloadWidgets)){
if([self isOscEnabled]) [self reloadLegacyWidgets:profile]; if([self isOnScreenWidgetEnabled]) [self reloadLegacyWidgets:profile];
else [self disableOnScreenControls]; else [self disableOnScreenControls];
} }
@@ -1059,8 +1053,8 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
[self startInteractionTimer]; [self startInteractionTimer];
NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches; NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches;
if(touchMode == NativeTouch || touchMode == RelativeTouch){ if(touchMode != AbsoluteTouch){
[self->_onScreenControls handleTouchDownEvent:targetTouches]; if([self isOnScreenWidgetEnabled]) [self->_onScreenControls handleTouchDownEvent:targetTouches];
[self->touchHandler touchesBegan:targetTouches withEvent:event]; [self->touchHandler touchesBegan:targetTouches withEvent:event];
} }
else if(![_onScreenControls handleTouchDownEvent:targetTouches]) [touchHandler touchesBegan:targetTouches withEvent:event]; else if(![_onScreenControls handleTouchDownEvent:targetTouches]) [touchHandler touchesBegan:targetTouches withEvent:event];
@@ -1236,9 +1230,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
hasUserInteracted = YES; hasUserInteracted = YES;
NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches; NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches;
if(self->touchMode == NativeTouch || self->touchMode == RelativeTouch){ if(self->touchMode != AbsoluteTouch){
[self->touchHandler touchesMoved:targetTouches withEvent:event]; [self->touchHandler touchesMoved:targetTouches withEvent:event];
[self->_onScreenControls handleTouchMovedEvent:targetTouches]; if([self isOnScreenWidgetEnabled]) [self->_onScreenControls handleTouchMovedEvent:targetTouches];
} }
else if(![self->_onScreenControls handleTouchMovedEvent:targetTouches]) [self->touchHandler touchesMoved:targetTouches withEvent:event]; else if(![self->_onScreenControls handleTouchMovedEvent:targetTouches]) [self->touchHandler touchesMoved:targetTouches withEvent:event];
} }
@@ -1388,9 +1382,9 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
hasUserInteracted = YES; hasUserInteracted = YES;
NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches; NSSet* targetTouches = nonPencilTouches ? nonPencilTouches : touches;
if(touchMode == NativeTouch || touchMode == RelativeTouch){ if(touchMode != AbsoluteTouch){
[self->touchHandler touchesEnded:targetTouches withEvent:event]; // when touches ended, must call the native touchhandler before onScreenControls, since the NSSet of touches captured by on screen button shall be updated later [self->touchHandler touchesEnded:targetTouches withEvent:event]; // when touches ended, must call the native touchhandler before onScreenControls, since the NSSet of touches captured by on screen button shall be updated later
[self->_onScreenControls handleTouchUpEvent:targetTouches]; if([self isOnScreenWidgetEnabled]) [self->_onScreenControls handleTouchUpEvent:targetTouches];
} }
else if(![_onScreenControls handleTouchUpEvent:targetTouches]) [touchHandler touchesEnded:targetTouches withEvent:event]; else if(![_onScreenControls handleTouchUpEvent:targetTouches]) [touchHandler touchesEnded:targetTouches withEvent:event];
} }
@@ -2543,7 +2543,8 @@ BOOL isCustomResolution(int resolutionSelected) {
} }
- (bool)isNotNativeTouchOnly{ - (bool)isNotNativeTouchOnly{
return (self.enableOswForNativeTouchSwitch.isOn && self.touchModeSelector1.selectedSegmentIndex == NativeTouch) || self.touchModeSelector1.selectedSegmentIndex != NativeTouch; // return (self.enableOswForNativeTouchSwitch.isOn && self.touchModeSelector1.selectedSegmentIndex == NativeTouch) || self.touchModeSelector1.selectedSegmentIndex != NativeTouch;
return true;
} }
- (void)handleOswGestureChange{ - (void)handleOswGestureChange{
@@ -3193,8 +3194,10 @@ BOOL isCustomResolution(int resolutionSelected) {
// bool customOscEnabled = [self isOswEnabled] && [self.onScreenWidgetSelector selectedSegmentIndex] == OnScreenControlsLevelCustom; // bool customOscEnabled = [self isOswEnabled] && [self.onScreenWidgetSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
bool isNativeTouch = sender.selectedSegmentIndex == NativeTouch; bool isNativeTouch = sender.selectedSegmentIndex == NativeTouch;
bool isEgmerging = self.enableOswSwitchStack.hidden != !isNativeTouch && isNativeTouch; // bool isEgmerging = self.enableOswSwitchStack.hidden != !isNativeTouch && isNativeTouch;
self.enableOswSwitchStack.hidden = !isNativeTouch; bool isEgmerging = false;
// self.enableOswSwitchStack.hidden = !isNativeTouch;
self.enableOswSwitchStack.hidden = true;
if(isEgmerging) [self highlightEmergingStack:self.enableOswSwitchStack]; if(isEgmerging) [self highlightEmergingStack:self.enableOswSwitchStack];
@@ -180,7 +180,7 @@
- (bool)isOnScreenWidgetEnabled{ - (bool)isOnScreenWidgetEnabled{
return (_oscProfile.touchMode == RelativeTouch || _oscProfile.touchMode == NativeTouch || _oscProfile.touchMode == AbsoluteTouch || _oscProfile.touchMode == TouchDisabled) && _settings.onscreenControls.intValue == OnScreenControlsLevelCustom; return _settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
} }
- (void)setupPiPControllerWithRenderer:(VideoDecoderRenderer *)videoRenderer { // Ensure we have the renderer and its layer - (void)setupPiPControllerWithRenderer:(VideoDecoderRenderer *)videoRenderer { // Ensure we have the renderer and its layer