diff --git a/Limelight/Base.lproj/iPad.storyboard b/Limelight/Base.lproj/iPad.storyboard
index eab90838..8eb1db03 100644
--- a/Limelight/Base.lproj/iPad.storyboard
+++ b/Limelight/Base.lproj/iPad.storyboard
@@ -63,23 +63,18 @@
-
-
+
+
-
+
+
+
+
+
+
-
+
@@ -93,14 +88,14 @@
-
+
-
+
@@ -159,7 +154,7 @@
-
+
@@ -184,7 +179,7 @@
-
+
@@ -204,7 +199,7 @@
-
+
@@ -226,8 +221,8 @@
-
-
+
+
@@ -236,23 +231,42 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -275,7 +289,7 @@
-
+
@@ -296,7 +310,7 @@
-
+
@@ -317,7 +331,7 @@
-
+
@@ -338,7 +352,7 @@
-
+
@@ -359,7 +373,7 @@
-
+
@@ -385,7 +399,7 @@
-
+
@@ -408,7 +422,7 @@
-
+
@@ -433,7 +447,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -457,7 +471,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -481,7 +495,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -506,7 +520,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -525,7 +539,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -548,7 +562,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -572,7 +586,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -595,7 +609,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -618,7 +632,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -642,7 +656,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -665,7 +679,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -688,7 +702,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -711,7 +725,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -735,7 +749,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -758,7 +772,7 @@ ICAgICAgICAgICAgICA
-
+
@@ -784,8 +798,6 @@ ICAgICAgICAgICAgICA
-
-
@@ -797,6 +809,8 @@ ICAgICAgICAgICAgICA
+
+
@@ -817,8 +831,8 @@ ICAgICAgICAgICAgICA
+
-
@@ -1418,16 +1432,16 @@ ICAgICAgICAgICAgICA
-
+
-
+
-
+
diff --git a/Limelight/Base.lproj/iPhone.storyboard b/Limelight/Base.lproj/iPhone.storyboard
index e30c3aa9..a969aea4 100644
--- a/Limelight/Base.lproj/iPhone.storyboard
+++ b/Limelight/Base.lproj/iPhone.storyboard
@@ -613,7 +613,7 @@ ICAgICAgICAgICAgIA
-
+
diff --git a/Limelight/Database/DataManager.h b/Limelight/Database/DataManager.h
index c78f9a99..a989c334 100644
--- a/Limelight/Database/DataManager.h
+++ b/Limelight/Database/DataManager.h
@@ -21,6 +21,13 @@ typedef NS_ENUM(NSUInteger, UINavigationBarHeight) {
UINavigationBarHeightIPhone = 44
};
+typedef NS_ENUM(NSInteger, TouchMode) {
+ RelativeTouch,
+ NativeTouch,
+ AbsoluteTouch,
+ NativeTouchOnly
+};
+
typedef NS_ENUM(NSInteger, TouchEventPriorityEnum) {
AsyncNativeTouchOff,
EqualPriority,
diff --git a/Limelight/Database/TemporarySettings.h b/Limelight/Database/TemporarySettings.h
index 107e617f..6a2e9f72 100644
--- a/Limelight/Database/TemporarySettings.h
+++ b/Limelight/Database/TemporarySettings.h
@@ -10,10 +10,6 @@
//
#import "Settings+CoreDataClass.h"
-#define RELATIVE_TOUCH 0
-#define REGULAR_NATIVE_TOUCH 1
-#define PURE_NATIVE_TOUCH 2
-#define ABSOLUTE_TOUCH 3
#define OSC_TOOL_FINGERS 4
diff --git a/Limelight/Input/ControllerSupport.m b/Limelight/Input/ControllerSupport.m
index e768aede..d50a4126 100644
--- a/Limelight/Input/ControllerSupport.m
+++ b/Limelight/Input/ControllerSupport.m
@@ -1087,7 +1087,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
// Even if no gamepads are present, we will always count one if OSC is enabled,
// or it's set to auto and no keyboard or mouse is present. Absolute touch mode
// disables the OSC.
- if (level != OnScreenControlsLevelOff && (![ControllerSupport hasKeyboardOrMouse] || level != OnScreenControlsLevelAuto) && (settings.touchMode.intValue == RELATIVE_TOUCH)) {
+ if (level != OnScreenControlsLevelOff && (![ControllerSupport hasKeyboardOrMouse] || level != OnScreenControlsLevelAuto) && (settings.touchMode.intValue == RelativeTouch)) {
mask |= 0x1;
}
diff --git a/Limelight/Input/StreamView.m b/Limelight/Input/StreamView.m
index f14d139b..a8f58fcf 100644
--- a/Limelight/Input/StreamView.m
+++ b/Limelight/Input/StreamView.m
@@ -114,7 +114,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
name:UIKeyboardWillHideNotification
object:nil];
- // if(settings.touchMode.intValue == PURE_NATIVE_TOUCH) [self addGestureRecognizer:keyboardToggleRecognizer]; //keep legacy approach in pure native mode
+ // if(settings.touchMode.intValue == NativeTouchOnly) [self addGestureRecognizer:keyboardToggleRecognizer]; //keep legacy approach in pure native mode
// else [self->streamFrameTopLayerView addGestureRecognizer:keyboardToggleRecognizer]; //add to the superview in other modes
[self->streamFrameTopLayerView addGestureRecognizer:keyboardToggleRecognizer]; //add to the superview in other modes
@@ -125,21 +125,22 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
#else
// iOS uses touch Mode depending on user preference
+ uint8_t mode = settings.touchMode.intValue;
switch (settings.touchMode.intValue) {
- case REGULAR_NATIVE_TOUCH:
+ case NativeTouch:
keyboardToggleRecognizer.immediateTriggering = false;
self->touchHandler = [[NativeTouchHandler alloc] initWithView:self andSettings:settings];break;
- case PURE_NATIVE_TOUCH:
+ case NativeTouchOnly:
keyboardToggleRecognizer.immediateTriggering = false;
self->touchHandler = [[PureNativeTouchHandler alloc] initWithView:self andSettings:settings];break;
- case RELATIVE_TOUCH:
+ case RelativeTouch:
self->touchHandler = [[RelativeTouchHandler alloc] initWithView:self andSettings:settings];
keyboardToggleRecognizer.immediateTriggering = false;
// if(settings.onscreenControls.intValue == OnScreenControlsLevelCustom) keyboardToggleRecognizer.numberOfTouchesRequired = 3; //deprecated: fixing keyboard taps to 3, in order to invoke OSC rebase in stream view by 4-finger tap.
break;
- case ABSOLUTE_TOUCH:
- self->touchHandler = [[AbsoluteTouchHandler alloc] initWithView:self];
+ case AbsoluteTouch:
+ self->touchHandler = [[AbsoluteTouchHandler alloc] initWithView:self];
keyboardToggleRecognizer.immediateTriggering = true; //triggers signal in touchesBegan callback stage
break;
@@ -151,13 +152,13 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
onScreenControls = [[OnScreenControls alloc] initWithView:self->streamFrameTopLayerView controllerSup:controllerSupport streamConfig:streamConfig]; // don't delete, this is mandatory
/*
// here we pass the tap recognizer to the onscreencontrols obj
- if (settings.touchMode.intValue == RELATIVE_TOUCH){
+ if (settings.touchMode.intValue == RelativeTouch){
RelativeTouchHandler* relativeTouchHandler = (RelativeTouchHandler*) touchHandler;
onScreenControls.mouseRightClickTapRecognizer = relativeTouchHandler.mouseRightClickTapRecognizer;
} */
OnScreenControlsLevel level = (OnScreenControlsLevel)[settings.onscreenControls integerValue];
- if (settings.touchMode.intValue != RELATIVE_TOUCH && settings.touchMode.intValue != REGULAR_NATIVE_TOUCH ) {
+ if (settings.touchMode.intValue != RelativeTouch && settings.touchMode.intValue != NativeTouch ) {
Log(LOG_I, @"On-screen controls disabled in non-relative touch mode");
[onScreenControls setLevel:OnScreenControlsLevelOff];
@@ -165,7 +166,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
[OnScreenControls.touchAddrsCapturedByOnScreenControls removeAllObjects]; // reset the attribute to nil
/*
- if(settings.touchMode.intValue == REGULAR_NATIVE_TOUCH){
+ if(settings.touchMode.intValue == NativeTouch){
NativeTouchHandler* nativeTouchHandler = (NativeTouchHandler* )touchHandler;
nativeTouchHandler.touchesCapturedByOnScreenButtons = onScreenControls.touchesCapturedByOnScreenButtons;
touchHandler = nativeTouchHandler;
@@ -335,12 +336,12 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
// we'll enable on screen buttons, and disable on screen controllers for absolute touch
- (bool) isOscEnabled{
- return (settings.touchMode.intValue == RELATIVE_TOUCH || settings.touchMode.intValue == REGULAR_NATIVE_TOUCH) && settings.onscreenControls.intValue != OnScreenControlsLevelOff;
+ return (settings.touchMode.intValue == RelativeTouch || settings.touchMode.intValue == NativeTouch) && settings.onscreenControls.intValue != OnScreenControlsLevelOff;
}
// we'll enable on screen buttons, and disable on screen controllers for absolute touch
- (bool) isOnScreenButtonEnabled{
- return (settings.touchMode.intValue == RELATIVE_TOUCH || settings.touchMode.intValue == REGULAR_NATIVE_TOUCH || settings.touchMode.intValue == ABSOLUTE_TOUCH) && settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
+ return (settings.touchMode.intValue == RelativeTouch || settings.touchMode.intValue == NativeTouch || settings.touchMode.intValue == AbsoluteTouch) && settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
}
- (void) reloadOnScreenControlsRealtimeWith:(ControllerSupport*)controllerSupport
@@ -583,7 +584,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
#if !TARGET_OS_TV
// if (@available(iOS 13.4, *)) {
// cancel restriction of native touch for iOS13.3 & lower
- if (settings.touchMode.intValue == PURE_NATIVE_TOUCH) {
+ if (settings.touchMode.intValue == NativeTouchOnly) {
[touchHandler touchesBegan:touches withEvent:event];
return; //This is a native touch oriented fork, in pure native touch mode, this call back method deals with native touch only.
}
@@ -608,7 +609,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
// Notify of user interaction and start expiration timer
[self startInteractionTimer];
- if(settings.touchMode.intValue == REGULAR_NATIVE_TOUCH || settings.touchMode.intValue == RELATIVE_TOUCH){
+ if(settings.touchMode.intValue == NativeTouch || settings.touchMode.intValue == RelativeTouch){
[self->onScreenControls handleTouchDownEvent:touches];
[self->touchHandler touchesBegan:touches withEvent:event];
}
@@ -740,7 +741,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
#if !TARGET_OS_TV
- if (settings.touchMode.intValue == PURE_NATIVE_TOUCH) {
+ if (settings.touchMode.intValue == NativeTouchOnly) {
[touchHandler touchesMoved:touches withEvent:event];
return; //This is a native touch oriented fork, in pure native touch mode, this call back method deals with native touch only.
}
@@ -773,7 +774,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
hasUserInteracted = YES;
- if(self->settings.touchMode.intValue == REGULAR_NATIVE_TOUCH || self->settings.touchMode.intValue == RELATIVE_TOUCH){
+ if(self->settings.touchMode.intValue == NativeTouch || self->settings.touchMode.intValue == RelativeTouch){
[self->touchHandler touchesMoved:touches withEvent:event];
[self->onScreenControls handleTouchMovedEvent:touches];
}
@@ -844,7 +845,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
#if !TARGET_OS_TV
- if (settings.touchMode.intValue == PURE_NATIVE_TOUCH) {
+ if (settings.touchMode.intValue == NativeTouchOnly) {
[touchHandler touchesEnded:touches withEvent:event];
return; //This is a native touch oriented fork, in pure native touch mode, this call back method deals with native touch only.
}
@@ -869,7 +870,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
hasUserInteracted = YES;
- if(settings.touchMode.intValue == REGULAR_NATIVE_TOUCH || settings.touchMode.intValue == RELATIVE_TOUCH){
+ if(settings.touchMode.intValue == NativeTouch || settings.touchMode.intValue == RelativeTouch){
[self->touchHandler touchesEnded:touches 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:touches];
}
@@ -879,7 +880,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
[touchHandler touchesCancelled:touches withEvent:event];
#if !TARGET_OS_TV
- if (settings.touchMode.intValue == PURE_NATIVE_TOUCH) return; //This is a native touch oriented fork, in pure native touch mode, this call back method deals with native touch only.
+ if (settings.touchMode.intValue == NativeTouchOnly) return; //This is a native touch oriented fork, in pure native touch mode, this call back method deals with native touch only.
if (@available(iOS 13.4, *)){ //now only pencil events are restricted
for (UITouch* touch in touches) {
if (touch.type == UITouchTypePencil) {
diff --git a/Limelight/MenuSectionView.h b/Limelight/MenuSectionView.h
index d707e32f..a948692e 100644
--- a/Limelight/MenuSectionView.h
+++ b/Limelight/MenuSectionView.h
@@ -31,4 +31,5 @@
- (void)updateLayout;
- (void)updateViewForFoldState;
+
@end
diff --git a/Limelight/ViewControllers/SWRevealViewController.m b/Limelight/ViewControllers/SWRevealViewController.m
index 83bf3bf7..1180c31f 100755
--- a/Limelight/ViewControllers/SWRevealViewController.m
+++ b/Limelight/ViewControllers/SWRevealViewController.m
@@ -695,7 +695,8 @@ const int FrontViewPositionNone = 0xff;
DataManager* dataMan = [[DataManager alloc] init];
TemporarySettings* currentSettings = [dataMan getSettings];
_rearViewRevealWidth = currentSettings.settingsMenuWidth.floatValue; //mark: settingMenuLayout
-
+ _rearViewRevealWidth = 390; //temp config for dev
+
// _rearViewRevealOverdraw = 60.0f;
_rearViewRevealOverdraw = 0.0f;
_rearViewRevealDisplacement = 40.0f;
diff --git a/Limelight/ViewControllers/SettingsViewController.h b/Limelight/ViewControllers/SettingsViewController.h
index 3ade300f..1dd1648d 100644
--- a/Limelight/ViewControllers/SettingsViewController.h
+++ b/Limelight/ViewControllers/SettingsViewController.h
@@ -21,7 +21,8 @@
@property (strong, nonatomic) IBOutlet UIStackView *fpsStack;
@property (strong, nonatomic) IBOutlet UIStackView *bitrateStack;
@property (strong, nonatomic) IBOutlet UIStackView *touchModeStack;
-@property (strong, nonatomic) IBOutlet UIStackView *asyncTouchStack;
+@property (weak, nonatomic) IBOutlet UIStackView *enableOswSwitchStack;
+//@property (strong, nonatomic) IBOutlet UIStackView *asyncTouchStack;
@property (strong, nonatomic) IBOutlet UIStackView *pointerVelocityDividerStack;
@property (strong, nonatomic) IBOutlet UIStackView *pointerVelocityFactorStack;
@property (strong, nonatomic) IBOutlet UIStackView *touchMoveEventIntervalStack;
@@ -55,9 +56,10 @@
@property (weak, nonatomic) IBOutlet UISwitch *customResolutionSwitch;
@property (strong, nonatomic) IBOutlet UILabel *touchModeLabel;
@property (strong, nonatomic) IBOutlet UISegmentedControl *touchModeSelector;
+@property (weak, nonatomic) IBOutlet UISwitch *enableOswForNativeTouchSwitch;
@property (strong, nonatomic) IBOutlet UILabel *onscreenControllerLabel;
-@property (strong, nonatomic) IBOutlet UISegmentedControl *onscreenControlSelector;
-@property (strong, nonatomic) IBOutlet UISegmentedControl *asyncNativeTouchPrioritySelector;
+@property (strong, nonatomic) IBOutlet UISegmentedControl *onScreenWidgetSelector;
+//@property (strong, nonatomic) IBOutlet UISegmentedControl *asyncNativeTouchPrioritySelector;
@property (strong, nonatomic) IBOutlet UISegmentedControl *optimizeSettingsSelector;
@property (strong, nonatomic) IBOutlet UISegmentedControl *multiControllerSelector;
@property (strong, nonatomic) IBOutlet UISegmentedControl *swapABXYButtonsSelector;
diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m
index dfff5aae..18477eb2 100644
--- a/Limelight/ViewControllers/SettingsViewController.m
+++ b/Limelight/ViewControllers/SettingsViewController.m
@@ -37,6 +37,7 @@
CADisplayLink *_autoScrollDisplayLink;
CGFloat _scrollSpeed;
CGFloat _currentRefreshRate;
+ MenuSectionView *touchControlSection;
}
@dynamic overrideUserInterfaceStyle;
@@ -474,7 +475,7 @@ BOOL isCustomResolution(CGSize res) {
[videoSection addToParentStack:parentStack];
[videoSection setExpanded:YES];
- MenuSectionView *touchControlSection = [[MenuSectionView alloc] init];
+ touchControlSection = [[MenuSectionView alloc] init];
touchControlSection.sectionTitle = [LocalizationHelper localizedStringForKey:@"Touch Control"];
if (@available(iOS 13.0, *)) {
[touchControlSection setSectionWithIcon:[UIImage imageNamed:@"arcade.stick.console"] andSize:20.5];
@@ -539,7 +540,7 @@ BOOL isCustomResolution(CGSize res) {
if (@available(iOS 13.0, *)) {
[experimentalSection setSectionWithIcon:[UIImage imageNamed:@"flask"] andSize:20];
}
- [self addSetting:self.asyncTouchStack ofId:@"asyncTouchStack" withInfoTag:YES withDynamicLabel:NO to:experimentalSection];
+ // [self addSetting:self.asyncTouchStack ofId:@"asyncTouchStack" withInfoTag:YES withDynamicLabel:NO to:experimentalSection];
[self addSetting:self.touchMoveEventIntervalStack ofId:@"touchMoveEventIntervalStack" withInfoTag:YES withDynamicLabel:NO to:experimentalSection];
[experimentalSection addToParentStack:parentStack];
[experimentalSection setExpanded:YES];
@@ -576,7 +577,7 @@ BOOL isCustomResolution(CGSize res) {
[parentStackTmp addArrangedSubview:self.bitrateStack];
// self.bitrateStack.hidden = YES;
[parentStackTmp addArrangedSubview:self.touchModeStack];
- [parentStackTmp addArrangedSubview:self.asyncTouchStack];
+ // [parentStackTmp addArrangedSubview:self.asyncTouchStack];
[parentStackTmp addArrangedSubview:self.pointerVelocityDividerStack];
[parentStackTmp addArrangedSubview:self.pointerVelocityFactorStack];
[parentStackTmp addArrangedSubview:self.touchMoveEventIntervalStack];
@@ -1269,9 +1270,8 @@ BOOL isCustomResolution(CGSize res) {
[self touchPointerVelocityFactorSliderMoved];
// async native touch event
- [self.asyncNativeTouchPrioritySelector setSelectedSegmentIndex:currentSettings.asyncNativeTouchPriority.intValue]; // load old setting of asyncNativeTouchPriority
- [self.asyncNativeTouchPrioritySelector addTarget:self action:@selector(asyncNativeTouchPriorityChanged) forControlEvents:UIControlEventValueChanged];
- [self asyncNativeTouchPriorityChanged];
+ // [self.asyncNativeTouchPrioritySelector setSelectedSegmentIndex:currentSettings.asyncNativeTouchPriority.intValue]; // load old setting of asyncNativeTouchPriority
+ // [self.asyncNativeTouchPrioritySelector addTarget:self action:@selector(asyncNativeTouchPriorityChanged) forControlEvents:UIControlEventValueChanged];
// init relative touch mouse pointer veloc setting, will be enable/disabled by touchMode
[self.mousePointerVelocityFactorSlider setValue:[self map_SliderValue_fromVelocFactor: currentSettings.mousePointerVelocityFactor.floatValue] animated:YES]; // Load old setting.
@@ -1288,8 +1288,8 @@ BOOL isCustomResolution(CGSize res) {
// this setting will be affected by touchMode, must be loaded before them.
NSInteger onscreenControlsLevel = [currentSettings.onscreenControls integerValue];
- [self.onscreenControlSelector setSelectedSegmentIndex:onscreenControlsLevel];
- [self.onscreenControlSelector addTarget:self action:@selector(onscreenControlChanged) forControlEvents:UIControlEventValueChanged];
+ [self.onScreenWidgetSelector setSelectedSegmentIndex:onscreenControlsLevel];
+ [self.onScreenWidgetSelector addTarget:self action:@selector(onscreenControlChanged) forControlEvents:UIControlEventValueChanged];
[self onscreenControlChanged];
// touch move event interval for native-touch.
@@ -1298,11 +1298,16 @@ BOOL isCustomResolution(CGSize res) {
[self touchMoveEventIntervalSliderMoved];
- // [self.touchModeSelector setSelectedSegmentIndex:currentSettings.absoluteTouchMode ? 1 : 0];
// this part will enable/disable oscSelector & the asyncNativeTouchPriority selector
- [self.touchModeSelector setSelectedSegmentIndex:currentSettings.touchMode.intValue]; //Load old touchMode setting
- [self.touchModeSelector addTarget:self action:@selector(touchModeChanged) forControlEvents:UIControlEventValueChanged];
- [self touchModeChanged];
+ uint8_t touchModeSelectorIndex = currentSettings.touchMode.intValue == NativeTouchOnly ? NativeTouch : currentSettings.touchMode.intValue;
+ [self.touchModeSelector setSelectedSegmentIndex:touchModeSelectorIndex]; //Load old touchMode setting
+ [self.touchModeSelector addTarget:self action:@selector(touchModeChanged:) forControlEvents:UIControlEventValueChanged];
+ [self touchModeChanged:self.touchModeSelector];
+
+ self.enableOswSwitchStack.hidden = !(currentSettings.touchMode.intValue == NativeTouch || currentSettings.touchMode.intValue == NativeTouchOnly);
+ [self.enableOswForNativeTouchSwitch setOn:currentSettings.touchMode.intValue != NativeTouchOnly];
+ [self.enableOswForNativeTouchSwitch addTarget:self action:@selector(enableOswForNativeTouchSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
+ [self enableOswForNativeTouchSwitchFlipped:self.enableOswForNativeTouchSwitch];
// init CustomOSC stuff
@@ -1333,13 +1338,13 @@ BOOL isCustomResolution(CGSize res) {
- (void)updateTouchModeLabel{
NSString* labelText;
switch([self.touchModeSelector selectedSegmentIndex]){
- case RELATIVE_TOUCH:
+ case RelativeTouch:
labelText = [LocalizationHelper localizedStringForKey:@"Touch Mode - Double Tap to Drag, OSC Available"];break;
- case REGULAR_NATIVE_TOUCH:
+ case NativeTouch:
labelText = [LocalizationHelper localizedStringForKey:@"Touch Mode - With OSC & Mouse Support"];break;
- case PURE_NATIVE_TOUCH:
+ case NativeTouchOnly:
labelText = [LocalizationHelper localizedStringForKey:@"Touch Mode - No OSC & Mouse Support"];break;
- case ABSOLUTE_TOUCH:
+ case AbsoluteTouch:
labelText = [LocalizationHelper localizedStringForKey:@"Touch Mode - For MacOS Direct Touch"];break;
}
[self.touchModeLabel setText:labelText];
@@ -1389,10 +1394,13 @@ BOOL isCustomResolution(CGSize res) {
-- (bool) isOnScreenControllerOrButtonEnabled{
- return ([self.touchModeSelector selectedSegmentIndex] == RELATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == REGULAR_NATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == ABSOLUTE_TOUCH) && [self.onscreenControlSelector selectedSegmentIndex] != OnScreenControlsLevelOff;
+- (bool)isOswEnabled{
+ return [self isNotNativeTouchOnly] && self.onScreenWidgetSelector.selectedSegmentIndex != OnScreenControlsLevelOff;
}
+- (bool)isNotNativeTouchOnly{
+ return (self.enableOswForNativeTouchSwitch.isOn && self.touchModeSelector.selectedSegmentIndex == NativeTouch) || self.touchModeSelector.selectedSegmentIndex == RelativeTouch || self.touchModeSelector.selectedSegmentIndex == AbsoluteTouch;
+}
- (void)onscreenControlChanged{
@@ -1408,7 +1416,7 @@ BOOL isCustomResolution(CGSize res) {
self.layoutOnScreenControlsVC.modalPresentationStyle = UIModalPresentationFullScreen;
}
- bool customOscEnabled = [self isOnScreenControllerOrButtonEnabled] && [self.onscreenControlSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
+ bool customOscEnabled = [self isOswEnabled] && [self.onScreenWidgetSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
// [self widget:self.keyboardToggleFingerNumSlider setEnabled:!customOscEnabled];
if(customOscEnabled && !justEnteredSettingsViewDoNotOpenOscLayoutTool) {
// [self.keyboardToggleFingerNumSlider setValue:3.0];
@@ -1489,40 +1497,36 @@ BOOL isCustomResolution(CGSize res) {
else widget.alpha = 0.5; // this is for updating widget visibility on low iOS version like mini5 ios14
}
+/*
- (void) asyncNativeTouchPriorityChanged {
- bool isNativeTouch = [self.touchModeSelector selectedSegmentIndex] == PURE_NATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == REGULAR_NATIVE_TOUCH;
+ bool isNativeTouch = [self.touchModeSelector selectedSegmentIndex] == NativeTouchOnly || [self.touchModeSelector selectedSegmentIndex] == NativeTouch;
bool asyncNativeTouchEnabled = [self.asyncNativeTouchPrioritySelector selectedSegmentIndex] != AsyncNativeTouchOff;
[self widget:self.touchMoveEventIntervalSlider setEnabled:isNativeTouch && asyncNativeTouchEnabled];
}
+*/
-- (void) touchModeChanged {
+- (void)touchModeChanged:(UISegmentedControl* )sender {
// Disable On-Screen Controls & Widgets in non-relative touch mode
- bool oscSelectorEnabled = [self.touchModeSelector selectedSegmentIndex] == RELATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == REGULAR_NATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == ABSOLUTE_TOUCH;
- bool customOscEnabled = [self isOnScreenControllerOrButtonEnabled] && [self.onscreenControlSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
- bool isNativeTouch = [self.touchModeSelector selectedSegmentIndex] == PURE_NATIVE_TOUCH || [self.touchModeSelector selectedSegmentIndex] == REGULAR_NATIVE_TOUCH;
- bool asyncNativeTouchEnabled = [self.asyncNativeTouchPrioritySelector selectedSegmentIndex] != AsyncNativeTouchOff;
+ // bool customOscEnabled = [self isOswEnabled] && [self.onScreenWidgetSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
+ bool isNativeTouch = sender.selectedSegmentIndex == NativeTouch;
+ //bool asyncNativeTouchEnabled = [self.asyncNativeTouchPrioritySelector selectedSegmentIndex] != AsyncNativeTouchOff;
+ self.enableOswSwitchStack.hidden = !isNativeTouch;
+ // [self.asyncNativeTouchPrioritySelector setEnabled:![self showOswSelector]]; // this selector stay aligned with oscSelector
+ self.touchMoveEventIntervalStack.hidden = !isNativeTouch; // applies to native touch modes only
+ self.pointerVelocityDividerStack.hidden = !isNativeTouch;
+ self.pointerVelocityFactorStack.hidden = !isNativeTouch;
+ self.mousePointerVelocityStack.hidden = !(sender.selectedSegmentIndex == RelativeTouch);
- [self.onscreenControlSelector setEnabled:oscSelectorEnabled];
- [self.asyncNativeTouchPrioritySelector setEnabled:isNativeTouch]; // this selector stay aligned with oscSelector
- [self widget:self.touchMoveEventIntervalSlider setEnabled:isNativeTouch && asyncNativeTouchEnabled]; // applies to native touch modes only
- [self widget:self.pointerVelocityModeDividerSlider setEnabled:isNativeTouch]; // pointer velocity scaling works only in native touch mode.
- [self widget:self.touchPointerVelocityFactorSlider setEnabled:isNativeTouch]; // pointer velocity scaling works only in native touch mode.
- [self widget:self.mousePointerVelocityFactorSlider setEnabled:[self.touchModeSelector selectedSegmentIndex] == RELATIVE_TOUCH]; // mouse velocity scaling works only in relative touch mode.
+ self.onScreenWidgetStack.hidden = ![self isNotNativeTouchOnly];
+ self.swapAbaxyStack.hidden = ![self isNotNativeTouchOnly];
- // number of touches required to toggle keyboard will be fixed to 3 when OSC is enabled.
- // [self widget:self.keyboardToggleFingerNumSlider setEnabled: !customOscEnabled]; // cancel OSC limitation for regular native touch,
- // when CustomOSC is enabled:
- if(customOscEnabled) {
- // [self.keyboardToggleFingerNumSlider setValue:3.0];
- // [self.keyboardToggleFingerNumLabel setText:[LocalizationHelper localizedStringForKey:@"To Toggle Local Keyboard: Tap %d Fingers", (uint16_t)self.keyboardToggleFingerNumSlider.value]];
- [self.onscreenControllerLabel setText:[LocalizationHelper localizedStringForKey: @"Tap %d Fingers to Change OSC Layout in Stream View", self->oscLayoutFingers]];
- [self keyboardToggleFingerNumSliderMoved]; // go exclude 5 fingers
- //if (self.layoutOnScreenControlsVC.isBeingPresented == NO)
- }
- else{
- [self.onscreenControllerLabel setText:[LocalizationHelper localizedStringForKey: @"On-Screen Controls & Widgets"]];
- }
- [self updateTouchModeLabel];
+ [touchControlSection updateViewForFoldState];
+}
+
+- (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{
+ self.onScreenWidgetStack.hidden = !sender.isOn;
+ self.swapAbaxyStack.hidden = !sender.isOn;
+ [touchControlSection updateViewForFoldState];
}
- (void) updateBitrate {
@@ -1701,7 +1705,7 @@ BOOL isCustomResolution(CGSize res) {
- (void) keyboardToggleFingerNumSliderMoved{
// bool oscEnabled = [self isOnScreenControllerOrButtonEnabled];
- bool customOscEnabled = [self isOnScreenControllerOrButtonEnabled] && [self.onscreenControlSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
+ bool customOscEnabled = [self isOswEnabled] && [self.onScreenWidgetSelector selectedSegmentIndex] == OnScreenControlsLevelCustom;
CGFloat sliderValue = self.keyboardToggleFingerNumSlider.value;
if(customOscEnabled){
@@ -1862,7 +1866,7 @@ BOOL isCustomResolution(CGSize res) {
NSInteger framerate = [self getChosenFrameRate];
NSInteger height = [self getChosenStreamHeight];
NSInteger width = [self getChosenStreamWidth];
- NSInteger onscreenControls = [self.onscreenControlSelector selectedSegmentIndex];
+ NSInteger onscreenControls = [self.onScreenWidgetSelector selectedSegmentIndex];
NSInteger keyboardToggleFingers = (uint16_t)self.keyboardToggleFingerNumSlider.value;
NSInteger oscLayoutToolFingers = (uint16_t)self->oscLayoutFingers;
// NSLog(@"saveSettings keyboardToggleFingers %d", (uint16_t)keyboardToggleFingers);
@@ -1872,11 +1876,10 @@ BOOL isCustomResolution(CGSize res) {
CGFloat touchPointerVelocityFactor = (CGFloat)(uint16_t)[self map_velocFactorDisplay_fromSliderValue:self.touchPointerVelocityFactorSlider.value]/100;
CGFloat mousePointerVelocityFactor = (CGFloat)(uint16_t)[self map_velocFactorDisplay_fromSliderValue:self.mousePointerVelocityFactorSlider.value]/100;
- // CGFloat mousePointerVelocityFactor =(CGFloat)(uint16_t)self.mousePointerVelocityFactorSlider.value/100;
uint16_t touchMoveEventInterval = (uint16_t)self.touchMoveEventIntervalSlider.value;
BOOL reverseMouseWheelDirection = [self.reverseMouseWheelDirectionSelector selectedSegmentIndex] == 1;
- NSInteger asyncNativeTouchPriority = [self.asyncNativeTouchPrioritySelector selectedSegmentIndex];
+ NSInteger asyncNativeTouchPriority = 1;
//BOOL liftStreamViewForKeyboard = [self.liftStreamViewForKeyboardSelector selectedSegmentIndex] == 1;
BOOL liftStreamViewForKeyboard = YES; // enable and hide this option
BOOL showKeyboardToolbar = [self.showKeyboardToolbarSelector selectedSegmentIndex] == 1;
@@ -1888,8 +1891,7 @@ BOOL isCustomResolution(CGSize res) {
BOOL enableYUV444 = self.yuv444Switch.isOn;
BOOL btMouseSupport = [self.btMouseSelector selectedSegmentIndex] == 1;
BOOL useFramePacing = [self.framePacingSelector selectedSegmentIndex] == 1;
- // BOOL absoluteTouchMode = [self.touchModeSelector selectedSegmentIndex] == 1;
- NSInteger touchMode = [self.touchModeSelector selectedSegmentIndex];
+ NSInteger touchMode = [self isNotNativeTouchOnly] ? self.touchModeSelector.selectedSegmentIndex : NativeTouchOnly;
NSInteger statsOverlayLevel = [self.statsOverlaySelector selectedSegmentIndex];
BOOL statsOverlayEnabled = statsOverlayLevel != 0;
BOOL enableHdr = self.hdrSwitch.isOn;
diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m
index eb3801fc..039b1f9d 100644
--- a/Limelight/ViewControllers/StreamFrameViewController.m
+++ b/Limelight/ViewControllers/StreamFrameViewController.m
@@ -91,7 +91,7 @@
- (bool)isOscLayoutToolEnabled{
- return (_settings.touchMode.intValue == RELATIVE_TOUCH || _settings.touchMode.intValue == REGULAR_NATIVE_TOUCH || _settings.touchMode.intValue == ABSOLUTE_TOUCH) && _settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
+ return (_settings.touchMode.intValue == RelativeTouch || _settings.touchMode.intValue == NativeTouch || _settings.touchMode.intValue == AbsoluteTouch) && _settings.onscreenControls.intValue == OnScreenControlsLevelCustom;
}
- (void)configOscLayoutTool{
@@ -103,7 +103,7 @@
_oscLayoutTapRecoginizer.tapDownTimeThreshold = 0.2;
_oscLayoutTapRecoginizer.delaysTouchesBegan = NO;
_oscLayoutTapRecoginizer.delaysTouchesEnded = NO;
- if(_settings.touchMode.intValue == ABSOLUTE_TOUCH) _oscLayoutTapRecoginizer.immediateTriggering = true; // make immediate triggering on for absolute touch mode
+ if(_settings.touchMode.intValue == AbsoluteTouch) _oscLayoutTapRecoginizer.immediateTriggering = true; // make immediate triggering on for absolute touch mode
[self.view addGestureRecognizer:_oscLayoutTapRecoginizer]; //
/* sets a reference to the correct 'LayoutOnScreenControlsViewController' depending on whether the user is on an iPhone or iPad */
@@ -150,7 +150,7 @@
}
- (void)configZoomGestureAndAddStreamView{
- if (_settings.touchMode.intValue == ABSOLUTE_TOUCH) {
+ if (_settings.touchMode.intValue == AbsoluteTouch) {
_scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
#if !TARGET_OS_TV
[_scrollView.panGestureRecognizer setMinimumNumberOfTouches:2];
diff --git a/Limelight/mul.lproj/iPad.xcstrings b/Limelight/mul.lproj/iPad.xcstrings
index 4c314d4c..518626ca 100644
--- a/Limelight/mul.lproj/iPad.xcstrings
+++ b/Limelight/mul.lproj/iPad.xcstrings
@@ -553,6 +553,36 @@
}
}
},
+ "AlL-fp-WCm.text" : {
+ "comment" : "Class = \"UILabel\"; text = \"Enable On-Screen Widget & Peripherals\"; ObjectID = \"AlL-fp-WCm\";",
+ "extractionState" : "extracted_with_value",
+ "localizations" : {
+ "en" : {
+ "stringUnit" : {
+ "state" : "new",
+ "value" : "Enable On-Screen Widget & Peripherals"
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "启用屏显控件与外设"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "启用屏显控件与外设"
+ }
+ },
+ "zh-HK" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "启用屏显控件与外设"
+ }
+ }
+ }
+ },
"aup-5k-z6P.text" : {
"comment" : "Class = \"UILabel\"; text = \"Show Local Keyboard Toolbar \"; ObjectID = \"aup-5k-z6P\";",
"extractionState" : "extracted_with_value",
@@ -794,37 +824,7 @@
}
},
"bhC-da-VGd.segmentTitles[2]" : {
- "comment" : "Class = \"UISegmentedControl\"; bhC-da-VGd.segmentTitles[2] = \"Native Only\"; ObjectID = \"bhC-da-VGd\";",
- "extractionState" : "extracted_with_value",
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "new",
- "value" : "Native Only"
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "仅多点触控"
- }
- },
- "zh-Hant" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "仅多点触控"
- }
- },
- "zh-HK" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "仅多点触控"
- }
- }
- }
- },
- "bhC-da-VGd.segmentTitles[3]" : {
- "comment" : "Class = \"UISegmentedControl\"; bhC-da-VGd.segmentTitles[3] = \"Absolute Touch\"; ObjectID = \"bhC-da-VGd\";",
+ "comment" : "Class = \"UISegmentedControl\"; bhC-da-VGd.segmentTitles[2] = \"Absolute Touch\"; ObjectID = \"bhC-da-VGd\";",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
@@ -1495,36 +1495,6 @@
}
}
},
- "e4G-id-vjI.segmentTitles[3]" : {
- "comment" : "Class = \"UISegmentedControl\"; e4G-id-vjI.segmentTitles[3] = \"Absolute Touch\"; ObjectID = \"e4G-id-vjI\";",
- "extractionState" : "stale",
- "localizations" : {
- "en" : {
- "stringUnit" : {
- "state" : "new",
- "value" : "Absolute Touch"
- }
- },
- "zh-Hans" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "单点鼠标"
- }
- },
- "zh-Hant" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "单点鼠标"
- }
- },
- "zh-HK" : {
- "stringUnit" : {
- "state" : "translated",
- "value" : "单点鼠标"
- }
- }
- }
- },
"egA-7n-Dpe.text" : {
"comment" : "Class = \"UILabel\"; text = \"Touch Pointer Velocity: 100% \"; ObjectID = \"egA-7n-Dpe\";",
"extractionState" : "extracted_with_value",