feat: optimized single point (absolute touch) for OSRS & regular use cases

This commit is contained in:
TrueZhuanjia committed 2025-11-03 23:58:49 +08:00
1 parent e0c556da10
commit e32a356cb5
14 files changed
+144 -131

No files matched your search

+9 -9
View File
@@ -1380,16 +1380,16 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Oyk-L5-WTt" userLabel="singleTapSensitivityStack"> <stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="Oyk-L5-WTt" userLabel="singleTapSensitivityStack">
<rect key="frame" x="440" y="307" width="700" height="55.5"/> <rect key="frame" x="440" y="307" width="708" height="55.5"/>
<subviews> <subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SuN-S2-8hj"> <label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SuN-S2-8hj">
<rect key="frame" x="0.0" y="0.0" width="700" height="20.5"/> <rect key="frame" x="0.0" y="0.0" width="708" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="j4n-De-TRX" userLabel="Single Tap Sensitivity Slider"> <slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="j4n-De-TRX" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="704" height="31"/> <rect key="frame" x="-2" y="25.5" width="712" height="31"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="30" id="qOF-42-hPO"/> <constraint firstAttribute="height" constant="30" id="qOF-42-hPO"/>
</constraints> </constraints>
@@ -1495,16 +1495,16 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Xp7-7O-Ndt"> <stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Xp7-7O-Ndt">
<rect key="frame" x="440" y="402" width="301.5" height="31"/> <rect key="frame" x="440" y="402" width="268" height="31"/>
<subviews> <subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Additional Left Click" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Yx-H8-E3N" userLabel="uiLabel"> <label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Delay Left Click" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Yx-H8-E3N" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="151.5" height="31"/> <rect key="frame" x="0.0" y="0.0" width="118" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Haf-rg-zLB"> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Haf-rg-zLB">
<rect key="frame" x="171.5" y="0.0" width="132" height="31"/> <rect key="frame" x="138" y="0.0" width="132" height="31"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="130" id="ouQ-r6-6Ix"/> <constraint firstAttribute="width" constant="130" id="ouQ-r6-6Ix"/>
</constraints> </constraints>
@@ -1541,8 +1541,6 @@
<connections> <connections>
<outlet property="appThemeSelector" destination="wi6-L4-KwS" id="mf9-YY-eyE"/> <outlet property="appThemeSelector" destination="wi6-L4-KwS" id="mf9-YY-eyE"/>
<outlet property="appThemeStack" destination="Wf6-BA-Mdv" id="hlq-bB-S8N"/> <outlet property="appThemeStack" destination="Wf6-BA-Mdv" id="hlq-bB-S8N"/>
<outlet property="appendLeftClickStack" destination="Xp7-7O-Ndt" id="CwB-Wy-beh"/>
<outlet property="appendLeftClickSwitch" destination="Haf-rg-zLB" id="FaA-3p-JDw"/>
<outlet property="audioConfigSelector" destination="iZL-dA-jk9" id="Yja-os-o6g"/> <outlet property="audioConfigSelector" destination="iZL-dA-jk9" id="Yja-os-o6g"/>
<outlet property="audioConfigStack" destination="qnG-5F-2YY" id="kFX-VK-vuK"/> <outlet property="audioConfigStack" destination="qnG-5F-2YY" id="kFX-VK-vuK"/>
<outlet property="audioEngineSelector" destination="85A-d5-pLE" id="Ads-EZ-Bpm"/> <outlet property="audioEngineSelector" destination="85A-d5-pLE" id="Ads-EZ-Bpm"/>
@@ -1561,6 +1559,8 @@
<outlet property="codecSelector" destination="aFy-0w-YPe" id="DlU-0l-gwz"/> <outlet property="codecSelector" destination="aFy-0w-YPe" id="DlU-0l-gwz"/>
<outlet property="codecStack" destination="gWg-BF-yDI" id="GGc-JQ-N8y"/> <outlet property="codecStack" destination="gWg-BF-yDI" id="GGc-JQ-N8y"/>
<outlet property="customResolutionSwitch" destination="E5w-kK-dOo" id="hrt-v2-8dY"/> <outlet property="customResolutionSwitch" destination="E5w-kK-dOo" id="hrt-v2-8dY"/>
<outlet property="delayLeftClickStack" destination="Xp7-7O-Ndt" id="CwB-Wy-beh"/>
<outlet property="delayLeftClickSwitch" destination="Haf-rg-zLB" id="FaA-3p-JDw"/>
<outlet property="duckOtherAppStack" destination="gBG-8F-6F8" id="T9P-ys-pHB"/> <outlet property="duckOtherAppStack" destination="gBG-8F-6F8" id="T9P-ys-pHB"/>
<outlet property="duckOtherAppSwitch" destination="YEv-1B-97I" id="o3Q-yt-74a"/> <outlet property="duckOtherAppSwitch" destination="YEv-1B-97I" id="o3Q-yt-74a"/>
<outlet property="edgeSlidingSensitivitySlider" destination="41s-BD-8rZ" id="ytk-Y5-Alq"/> <outlet property="edgeSlidingSensitivitySlider" destination="41s-BD-8rZ" id="ytk-Y5-Alq"/>
+9 -9
View File
@@ -2214,16 +2214,16 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="N0i-z6-WgC" userLabel="singleTapSensitivityStack"> <stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="N0i-z6-WgC" userLabel="singleTapSensitivityStack">
<rect key="frame" x="437" y="2383" width="448" height="55.5"/> <rect key="frame" x="437" y="2383" width="456" height="55.5"/>
<subviews> <subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WzD-wo-Wum"> <label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Single Tap Sensitivity" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WzD-wo-Wum">
<rect key="frame" x="0.0" y="0.0" width="448" height="20.5"/> <rect key="frame" x="0.0" y="0.0" width="456" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="uCa-Oa-7mv" userLabel="Single Tap Sensitivity Slider"> <slider verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="2" minValue="0.0" maxValue="5" minimumValueImage="0.square" catalog="system" maximumValueImage="5.square" translatesAutoresizingMaskIntoConstraints="NO" id="uCa-Oa-7mv" userLabel="Single Tap Sensitivity Slider">
<rect key="frame" x="-2" y="25.5" width="452" height="31"/> <rect key="frame" x="-2" y="25.5" width="460" height="31"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="30" id="XXP-GP-uhn"/> <constraint firstAttribute="height" constant="30" id="XXP-GP-uhn"/>
</constraints> </constraints>
@@ -2258,16 +2258,16 @@
</constraints> </constraints>
</stackView> </stackView>
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="fjb-oT-r1E"> <stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="fjb-oT-r1E">
<rect key="frame" x="437" y="340" width="301.5" height="31"/> <rect key="frame" x="437" y="340" width="268" height="31"/>
<subviews> <subviews>
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Additional Left Click" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qOa-te-sPj" userLabel="uiLabel"> <label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Delay Left Click" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qOa-te-sPj" userLabel="uiLabel">
<rect key="frame" x="0.0" y="0.0" width="151.5" height="31"/> <rect key="frame" x="0.0" y="0.0" width="118" height="31"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YB5-xe-Zdx"> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YB5-xe-Zdx">
<rect key="frame" x="171.5" y="0.0" width="132" height="31"/> <rect key="frame" x="138" y="0.0" width="132" height="31"/>
<constraints> <constraints>
<constraint firstAttribute="width" constant="130" id="Lry-88-Pdv"/> <constraint firstAttribute="width" constant="130" id="Lry-88-Pdv"/>
</constraints> </constraints>
@@ -2324,8 +2324,6 @@
<connections> <connections>
<outlet property="appThemeSelector" destination="pNz-vd-Sr9" id="nYB-7o-wkT"/> <outlet property="appThemeSelector" destination="pNz-vd-Sr9" id="nYB-7o-wkT"/>
<outlet property="appThemeStack" destination="Wpg-TL-KJy" id="Vhd-oB-Sy3"/> <outlet property="appThemeStack" destination="Wpg-TL-KJy" id="Vhd-oB-Sy3"/>
<outlet property="appendLeftClickStack" destination="fjb-oT-r1E" id="0Tb-f9-Pym"/>
<outlet property="appendLeftClickSwitch" destination="YB5-xe-Zdx" id="FEK-Lb-f0r"/>
<outlet property="audioConfigSelector" destination="hfR-K8-Ti4" id="4La-bI-jLq"/> <outlet property="audioConfigSelector" destination="hfR-K8-Ti4" id="4La-bI-jLq"/>
<outlet property="audioConfigStack" destination="Rld-CY-qzs" id="dmf-m8-sor"/> <outlet property="audioConfigStack" destination="Rld-CY-qzs" id="dmf-m8-sor"/>
<outlet property="audioEngineSelector" destination="pVq-EW-Dta" id="fcu-q8-UNI"/> <outlet property="audioEngineSelector" destination="pVq-EW-Dta" id="fcu-q8-UNI"/>
@@ -2344,6 +2342,8 @@
<outlet property="codecSelector" destination="5Y7-To-ca2" id="Kmt-sp-eXj"/> <outlet property="codecSelector" destination="5Y7-To-ca2" id="Kmt-sp-eXj"/>
<outlet property="codecStack" destination="cVe-Uk-gXv" id="826-Tv-rMl"/> <outlet property="codecStack" destination="cVe-Uk-gXv" id="826-Tv-rMl"/>
<outlet property="customResolutionSwitch" destination="kRO-HO-zKO" id="ZUP-Yd-QDY"/> <outlet property="customResolutionSwitch" destination="kRO-HO-zKO" id="ZUP-Yd-QDY"/>
<outlet property="delayLeftClickStack" destination="fjb-oT-r1E" id="0Tb-f9-Pym"/>
<outlet property="delayLeftClickSwitch" destination="YB5-xe-Zdx" id="FEK-Lb-f0r"/>
<outlet property="duckOtherAppStack" destination="FkE-Sc-6kA" id="YUO-j1-Bdv"/> <outlet property="duckOtherAppStack" destination="FkE-Sc-6kA" id="YUO-j1-Bdv"/>
<outlet property="duckOtherAppSwitch" destination="71J-Gt-A3D" id="3iT-jh-hWx"/> <outlet property="duckOtherAppSwitch" destination="71J-Gt-A3D" id="3iT-jh-hWx"/>
<outlet property="edgeSlidingSensitivitySlider" destination="KRf-2B-Reb" id="UaG-GM-wkO"/> <outlet property="edgeSlidingSensitivitySlider" destination="KRf-2B-Reb" id="UaG-GM-wkO"/>
+1 -1
View File
@@ -126,7 +126,7 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) {
hapticEngine:(NSInteger)hapticEngine hapticEngine:(NSInteger)hapticEngine
edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity
audioEngine:(NSInteger)audioEngine audioEngine:(NSInteger)audioEngine
appendLeftClick:(BOOL)appendLeftClick delayLeftClick:(BOOL)delayLeftClick
duckOtherApps:(BOOL)duckOtherApps duckOtherApps:(BOOL)duckOtherApps
muteInBackground:(BOOL)muteInBackground muteInBackground:(BOOL)muteInBackground
backgroundSessionTimer:(NSInteger)backgroundSessionTimer; backgroundSessionTimer:(NSInteger)backgroundSessionTimer;
+2 -2
View File
@@ -109,7 +109,7 @@
hapticEngine:(NSInteger)hapticEngine hapticEngine:(NSInteger)hapticEngine
edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity
audioEngine:(NSInteger)audioEngine audioEngine:(NSInteger)audioEngine
appendLeftClick:(BOOL)appendLeftClick delayLeftClick:(BOOL)delayLeftClick
duckOtherApps:(BOOL)duckOtherApps duckOtherApps:(BOOL)duckOtherApps
muteInBackground:(BOOL)muteInBackground muteInBackground:(BOOL)muteInBackground
backgroundSessionTimer:(NSInteger)backgroundSessionTimer{ backgroundSessionTimer:(NSInteger)backgroundSessionTimer{
@@ -171,7 +171,7 @@
settingsToSave.hapticEngine = [NSNumber numberWithInteger:hapticEngine]; settingsToSave.hapticEngine = [NSNumber numberWithInteger:hapticEngine];
settingsToSave.edgeSlidingSensitivity = [NSNumber numberWithFloat:edgeSlidingSensitivity]; settingsToSave.edgeSlidingSensitivity = [NSNumber numberWithFloat:edgeSlidingSensitivity];
settingsToSave.audioEngine = [NSNumber numberWithInteger:audioEngine]; settingsToSave.audioEngine = [NSNumber numberWithInteger:audioEngine];
settingsToSave.appendLeftClick = appendLeftClick; settingsToSave.delayLeftClick = delayLeftClick;
settingsToSave.duckOtherApps = duckOtherApps; settingsToSave.duckOtherApps = duckOtherApps;
settingsToSave.muteInBackground = muteInBackground; settingsToSave.muteInBackground = muteInBackground;
settingsToSave.rememberFoldState = rememberFoldState; settingsToSave.rememberFoldState = rememberFoldState;
+1 -1
View File
@@ -83,7 +83,7 @@
@property (nonatomic, retain) NSNumber * appTheme; @property (nonatomic, retain) NSNumber * appTheme;
@property (nonatomic, retain) NSNumber * edgeSlidingSensitivity; @property (nonatomic, retain) NSNumber * edgeSlidingSensitivity;
@property (nonatomic, retain) NSNumber * audioEngine; @property (nonatomic, retain) NSNumber * audioEngine;
@property (nonatomic) BOOL appendLeftClick; @property (nonatomic) BOOL delayLeftClick;
@property (nonatomic) BOOL duckOtherApps; @property (nonatomic) BOOL duckOtherApps;
@property (nonatomic) BOOL muteInBackground; @property (nonatomic) BOOL muteInBackground;
@property (nonatomic, retain) NSNumber * framePacingMode; @property (nonatomic, retain) NSNumber * framePacingMode;
+1 -1
View File
@@ -140,7 +140,7 @@
self.hapticEngine = settings.hapticEngine; self.hapticEngine = settings.hapticEngine;
self.uniqueId = settings.uniqueId; self.uniqueId = settings.uniqueId;
self.audioEngine = settings.audioEngine; self.audioEngine = settings.audioEngine;
self.appendLeftClick = settings.appendLeftClick; self.delayLeftClick = settings.delayLeftClick;
self.duckOtherApps = settings.duckOtherApps; self.duckOtherApps = settings.duckOtherApps;
self.muteInBackground = settings.muteInBackground; self.muteInBackground = settings.muteInBackground;
#endif #endif
+60 -20
View File
@@ -17,7 +17,7 @@
#define LONG_PRESS_ACTIVATION_DELAY 0.650f #define LONG_PRESS_ACTIVATION_DELAY 0.650f
// How far the finger can move before it cancels a right click // How far the finger can move before it cancels a right click
#define LONG_PRESS_ACTIVATION_DELTA 0.01f #define LONG_PRESS_ACTIVATION_DELTA 0.02f
// How long the double tap deadzone stays in effect between touch up and touch down // How long the double tap deadzone stays in effect between touch up and touch down
#define DOUBLE_TAP_DEAD_ZONE_DELAY 0.250f #define DOUBLE_TAP_DEAD_ZONE_DELAY 0.250f
@@ -34,20 +34,30 @@
UITouch* lastTouchUp; UITouch* lastTouchUp;
CGPoint lastTouchUpLocation; CGPoint lastTouchUpLocation;
CGPoint touchBeganLocation;
CGPoint movingTouchLocation;
NSTimeInterval touchBeganTimeStamp;
NSTimeInterval leftClickTimeThreshold;
// upper screen edge check // upper screen edge check
bool touchPointSpawnedAtUpperScreenEdge; bool touchPointSpawnedAtUpperScreenEdge;
CGFloat slideGestureVerticalThreshold; CGFloat slideGestureVerticalThreshold;
CGFloat screenWidthWithThreshold; CGFloat screenWidthWithThreshold;
CGFloat _edgeTolerance; CGFloat _edgeTolerance;
bool _appendMouseLeftClick; bool _delayMouseLeftClick;
bool rightButtonClicked;
} }
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings { - (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings {
self = [self init]; self = [self init];
self->streamView = view; self->streamView = view;
_appendMouseLeftClick = settings.appendLeftClick; _delayMouseLeftClick = settings.delayLeftClick;
leftClickTimeThreshold = 0.15;
// upper screen check // upper screen check
_edgeTolerance = settings.edgeSlidingSensitivity.floatValue; _edgeTolerance = settings.edgeSlidingSensitivity.floatValue;
@@ -60,11 +70,19 @@
- (void)onLongPressStart:(NSTimer*)timer { - (void)onLongPressStart:(NSTimer*)timer {
// Raise the left click and start a right click // Raise the left click and start a right click
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT); if([self touchDidntMoveOnScreen:movingTouchLocation]){
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_RIGHT); if(_delayMouseLeftClick) LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_RIGHT);
dispatch_time_t delayShort = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC));
dispatch_after(delayShort, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_RIGHT);
self->rightButtonClicked = true;
});
}
} }
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
rightButtonClicked = false;
CGPoint initialPoint = [[touches anyObject] locationInView:streamView]; CGPoint initialPoint = [[touches anyObject] locationInView:streamView];
if(initialPoint.y < slideGestureVerticalThreshold && (initialPoint.x < _edgeTolerance || initialPoint.x > screenWidthWithThreshold)) { if(initialPoint.y < slideGestureVerticalThreshold && (initialPoint.x < _edgeTolerance || initialPoint.x > screenWidthWithThreshold)) {
@@ -82,6 +100,8 @@
UITouch* touch = [touches anyObject]; UITouch* touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView:streamView]; CGPoint touchLocation = [touch locationInView:streamView];
touchBeganTimeStamp = touch.timestamp;
// Don't reposition for finger down events within the deadzone. This makes double-clicking easier. // Don't reposition for finger down events within the deadzone. This makes double-clicking easier.
if (touch.timestamp - lastTouchUp.timestamp > DOUBLE_TAP_DEAD_ZONE_DELAY || if (touch.timestamp - lastTouchUp.timestamp > DOUBLE_TAP_DEAD_ZONE_DELAY ||
sqrt(pow((touchLocation.x / streamView.bounds.size.width) - (lastTouchUpLocation.x / streamView.bounds.size.width), 2) + sqrt(pow((touchLocation.x / streamView.bounds.size.width) - (lastTouchUpLocation.x / streamView.bounds.size.width), 2) +
@@ -90,7 +110,7 @@
} }
// Press the left button down // Press the left button down
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT); if(!_delayMouseLeftClick) LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
// Start the long press timer // Start the long press timer
longPressTimer = [NSTimer scheduledTimerWithTimeInterval:LONG_PRESS_ACTIVATION_DELAY longPressTimer = [NSTimer scheduledTimerWithTimeInterval:LONG_PRESS_ACTIVATION_DELAY
@@ -101,6 +121,8 @@
lastTouchDown = touch; lastTouchDown = touch;
lastTouchDownLocation = touchLocation; lastTouchDownLocation = touchLocation;
movingTouchLocation = touchLocation;
touchBeganLocation = touchLocation;
} }
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -113,16 +135,19 @@
} }
UITouch* touch = [touches anyObject]; UITouch* touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView:streamView]; movingTouchLocation = [touch locationInView:streamView];
if (sqrt(pow((touchLocation.x / streamView.bounds.size.width) - (lastTouchDownLocation.x / streamView.bounds.size.width), 2) + if (sqrt(pow((movingTouchLocation.x / streamView.bounds.size.width) - (lastTouchDownLocation.x / streamView.bounds.size.width), 2) +
pow((touchLocation.y / streamView.bounds.size.height) - (lastTouchDownLocation.y / streamView.bounds.size.height), 2)) > LONG_PRESS_ACTIVATION_DELTA) { pow((movingTouchLocation.y / streamView.bounds.size.height) - (lastTouchDownLocation.y / streamView.bounds.size.height), 2)) > LONG_PRESS_ACTIVATION_DELTA) {
// Moved too far since touch down. Cancel the long press timer. // Moved too far since touch down. Cancel the long press timer.
[longPressTimer invalidate]; [longPressTimer invalidate];
longPressTimer = nil; longPressTimer = nil;
if(_delayMouseLeftClick && (CACurrentMediaTime()-touchBeganTimeStamp>leftClickTimeThreshold)) LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
} }
[streamView updateCursorLocation:[[touches anyObject] locationInView:streamView] isMouse:NO]; if(!rightButtonClicked) [streamView updateCursorLocation:[[touches anyObject] locationInView:streamView] isMouse:NO];
} }
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -134,18 +159,32 @@
// Cancel the long press timer // Cancel the long press timer
[longPressTimer invalidate]; [longPressTimer invalidate];
longPressTimer = nil; longPressTimer = nil;
// Left button up on finger up
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
// Raise right button too in case we triggered a long press gesture
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_RIGHT);
// Remember this last touch for touch-down deadzoning // Remember this last touch for touch-down deadzoning
UITouch* touch = [touches anyObject];
CGPoint touchLocation = [touch locationInView:streamView];
if(_delayMouseLeftClick){
if(CACurrentMediaTime()-touchBeganTimeStamp<leftClickTimeThreshold) {
if(CACurrentMediaTime()-lastTouchUp.timestamp<0.15
&& ![self isAdjacentPoints:touchLocation from:lastTouchUpLocation tolerance:30]) [streamView updateCursorLocation:touchLocation isMouse:NO];
if([self touchDidntMoveOnScreen:touchLocation] && !rightButtonClicked) [self sendShortMouseLeftButtonClickEvent];
}
else if(!rightButtonClicked){
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_RIGHT);
}
}
else{
// Left button up on finger up
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
// Raise right button too in case we triggered a long press gesture
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_RIGHT);
}
lastTouchUp = [touches anyObject]; lastTouchUp = [touches anyObject];
lastTouchUpLocation = [lastTouchUp locationInView:streamView]; lastTouchUpLocation = [lastTouchUp locationInView:streamView];
if(_appendMouseLeftClick && [self touchDidntMoveOnScreen:lastTouchUp]) [self sendShortMouseLeftButtonClickEvent];
} }
} }
@@ -161,12 +200,13 @@
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT); LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
dispatch_after(delayLong, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_after(delayLong, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT); LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_RIGHT);
}); });
}); });
} }
- (bool)touchDidntMoveOnScreen:(UITouch* )touch{ - (bool)touchDidntMoveOnScreen:(CGPoint)touchLocation{
return [self isAdjacentPoints:[touch locationInView:streamView] from:lastTouchDownLocation tolerance:3]; return [self isAdjacentPoints:touchLocation from:touchBeganLocation tolerance:3];
} }
- (BOOL)isAdjacentPoints:(CGPoint)currentPoint from:(CGPoint)originalPoint tolerance:(CGFloat)tolerance { - (BOOL)isAdjacentPoints:(CGPoint)currentPoint from:(CGPoint)originalPoint tolerance:(CGFloat)tolerance {
+10 -35
View File
@@ -17,6 +17,7 @@
@implementation NativeTouchHandler { @implementation NativeTouchHandler {
StreamView* streamView; StreamView* streamView;
TemporarySettings* currentSettings; TemporarySettings* currentSettings;
bool activateCoordSelector;
CGFloat pointerVelocityDividerLocationByPoints; CGFloat pointerVelocityDividerLocationByPoints;
bool asyncNativeTouch; bool asyncNativeTouch;
@@ -42,14 +43,13 @@
CGRect streamViewBounds; CGRect streamViewBounds;
int64_t moveEventIntervalNSec; int64_t moveEventIntervalNSec;
bool _appendMouseLeftClick;
} }
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings{ - (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings{
self = [super init]; self = [super init];
self->streamView = view; self->streamView = view;
self->currentSettings = settings; self->currentSettings = settings;
self->activateCoordSelector = currentSettings.pointerVelocityModeDivider.floatValue != 1.0;
self->moveEventIntervalNSec = (int64_t)(currentSettings.touchMoveEventInterval.intValue * 1000);; self->moveEventIntervalNSec = (int64_t)(currentSettings.touchMoveEventInterval.intValue * 1000);;
self->streamViewBounds = view.bounds; self->streamViewBounds = view.bounds;
@@ -60,9 +60,7 @@
} }
self->activePointerIds = [NSMutableSet set]; self->activePointerIds = [NSMutableSet set];
self->blacklistedTouches = [NSMutableSet set]; self->blacklistedTouches = [NSMutableSet set];
_appendMouseLeftClick = settings.appendLeftClick;
self->asyncNativeTouch = settings.asyncNativeTouchPriority.intValue != AsyncNativeTouchOff; self->asyncNativeTouch = settings.asyncNativeTouchPriority.intValue != AsyncNativeTouchOff;
switch(settings.asyncNativeTouchPriority.intValue){ switch(settings.asyncNativeTouchPriority.intValue){
@@ -197,7 +195,7 @@
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved); //NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
// NSLog(@"excluded count: %d", (uint32_t)[excludedPointerIds count]); // NSLog(@"excluded count: %d", (uint32_t)[excludedPointerIds count]);
targetCoords = [self selectCoordsFor:touch]; targetCoords = activateCoordSelector ? [self selectCoordsFor:touch] : [touch locationInView:streamView];
CGPoint location = [self adjustCoordinatesForVideoArea:targetCoords]; CGPoint location = [self adjustCoordinatesForVideoArea:targetCoords];
CGSize videoSize = [self getVideoAreaSize]; CGSize videoSize = [self getVideoAreaSize];
@@ -217,7 +215,7 @@
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch // continue to the next loop if current touch is already captured by OSC. works only in regular native touch
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue; if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
[self handleTouchDown:touch]; //generate & populate pointerId [self handleTouchDown:touch]; //generate & populate pointerId
[self populatePointerObjIntoDict:touch]; if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN]; [self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
} }
}); });
@@ -226,7 +224,7 @@
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch // continue to the next loop if current touch is already captured by OSC. works only in regular native touch
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue; if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
[self handleTouchDown:touch]; //generate & populate pointerId [self handleTouchDown:touch]; //generate & populate pointerId
[self populatePointerObjIntoDict:touch]; if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN]; [self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
} }
} }
@@ -236,7 +234,7 @@
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, moveEventIntervalNSec), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, moveEventIntervalNSec), dispatch_get_main_queue(), ^{
for (UITouch* touch in touches){ for (UITouch* touch in touches){
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue; if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
[self updatePointerObjInDict:touch]; if(self->activateCoordSelector) [self updatePointerObjInDict:touch];
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_MOVE]; [self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_MOVE];
[[self getPointerObjFromDict:touch] doesNeedResetCoords]; [[self getPointerObjFromDict:touch] doesNeedResetCoords];
} }
@@ -253,11 +251,8 @@
} }
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId [self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId
[self removePointerId:touch]; //then remove pointerId [self removePointerId:touch]; //then remove pointerId
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
if(self->_appendMouseLeftClick && [self touchDidntMoveOnScreen:touch]) [self sendShortMouseLeftButtonClickEvent]; [self->blacklistedTouches removeObject:@((uintptr_t)touch)];
[self removePointerObjFromDict:touch];
[self->blacklistedTouches removeObject:touchAddrObj];
} }
}); });
} }
@@ -266,6 +261,7 @@
[self touchesEnded:touches withEvent:event]; [self touchesEnded:touches withEvent:event];
} }
- (void)populatePointerObjIntoDict:(UITouch*)touch{ - (void)populatePointerObjIntoDict:(UITouch*)touch{
NativeTouchPointer* pointer = [[NativeTouchPointer alloc] initWithTouch:touch]; NativeTouchPointer* pointer = [[NativeTouchPointer alloc] initWithTouch:touch];
pointer.useRelativeCoords = pointer.initialPoint.x > pointerVelocityDividerLocationByPoints; pointer.useRelativeCoords = pointer.initialPoint.x > pointerVelocityDividerLocationByPoints;
@@ -294,25 +290,4 @@
return pointer.useRelativeCoords ? pointer.latestRelativePoint : pointer.latestPoint; return pointer.useRelativeCoords ? pointer.latestRelativePoint : pointer.latestPoint;
} }
- (void)sendShortMouseLeftButtonClickEvent{
dispatch_time_t delayShort = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC));
dispatch_time_t delayLong = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.03 * NSEC_PER_SEC));
dispatch_after(delayShort, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
dispatch_after(delayLong, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
});
});
}
- (bool)touchDidntMoveOnScreen:(UITouch* )touch{
NativeTouchPointer *pointer = [pointerObjDict objectForKey:@((uintptr_t)touch)];
return [self isAdjacentPoints:[touch locationInView:streamView] from:pointer.initialPoint tolerance:3];
}
- (BOOL)isAdjacentPoints:(CGPoint)currentPoint from:(CGPoint)originalPoint tolerance:(CGFloat)tolerance {
bool isAdjacent = hypotf(originalPoint.x - currentPoint.x, originalPoint.y - currentPoint.y) <= hypot(tolerance, tolerance);
return isAdjacent;
}
@end @end
@@ -21,7 +21,6 @@
<relationship name="appList" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="App" inverseName="host" inverseEntity="App" syncable="YES"/> <relationship name="appList" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="App" inverseName="host" inverseEntity="App" syncable="YES"/>
</entity> </entity>
<entity name="Settings" representedClassName="Settings" syncable="YES" codeGenerationType="class"> <entity name="Settings" representedClassName="Settings" syncable="YES" codeGenerationType="class">
<attribute name="appendLeftClick" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="appTheme" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/> <attribute name="appTheme" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="asyncNativeTouchPriority" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/> <attribute name="asyncNativeTouchPriority" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="audioConfig" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/> <attribute name="audioConfig" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/>
@@ -30,6 +29,7 @@
<attribute name="bitrate" attributeType="Integer 32" defaultValueString="10000" usesScalarValueType="NO" syncable="YES"/> <attribute name="bitrate" attributeType="Integer 32" defaultValueString="10000" usesScalarValueType="NO" syncable="YES"/>
<attribute name="btMouseSupport" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/> <attribute name="btMouseSupport" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="buttonVisualFeedback" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/> <attribute name="buttonVisualFeedback" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="delayLeftClick" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
<attribute name="deviceGyroMode" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/> <attribute name="deviceGyroMode" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
<attribute name="duckOtherApps" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/> <attribute name="duckOtherApps" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
<attribute name="edgeSlidingSensitivity" optional="YES" attributeType="Float" defaultValueString="22" usesScalarValueType="NO" syncable="YES"/> <attribute name="edgeSlidingSensitivity" optional="YES" attributeType="Float" defaultValueString="22" usesScalarValueType="NO" syncable="YES"/>
+29 -29
View File
@@ -766,35 +766,6 @@
} }
} }
}, },
"appendLeftClickStackTip" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "This works for games like “Old School RuneScape” that requires double tap on touch screen"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "对需要在触摸屏上双击的游戏, 如 OSRS (Old School RuneScape) 有效"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "對需要在觸控螢幕上雙擊的遊戲, 如 OSRS(Old School RuneScape)有效"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "needs_review",
"value" : "對需要在觸控螢幕上雙擊的遊戲, 如 OSRS(Old School RuneScape)有效"
}
}
}
},
"Applications" : { "Applications" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "localizations" : {
@@ -1566,6 +1537,35 @@
} }
} }
}, },
"delayLeftClickStackTip" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Optimized for game “Old School RuneScape”."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "对 OSRS (Old School RuneScape) 有效"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "對 OSRS(Old School RuneScape)有效"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "對 OSRS(Old School RuneScape)有效"
}
}
}
},
"Delete" : { "Delete" : {
"extractionState" : "manual", "extractionState" : "manual",
"localizations" : { "localizations" : {
@@ -181,8 +181,8 @@
@property (strong, nonatomic) IBOutlet UIStackView *audioEngineStack; @property (strong, nonatomic) IBOutlet UIStackView *audioEngineStack;
@property (strong, nonatomic) IBOutlet UISegmentedControl *audioEngineSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *audioEngineSelector;
@property (strong, nonatomic) IBOutlet UIStackView *appendLeftClickStack; @property (strong, nonatomic) IBOutlet UIStackView *delayLeftClickStack;
@property (strong, nonatomic) IBOutlet UISwitch *appendLeftClickSwitch; @property (strong, nonatomic) IBOutlet UISwitch *delayLeftClickSwitch;
@property (strong, nonatomic) IBOutlet UIStackView *duckOtherAppStack; @property (strong, nonatomic) IBOutlet UIStackView *duckOtherAppStack;
@property (strong, nonatomic) IBOutlet UISwitch *duckOtherAppSwitch; @property (strong, nonatomic) IBOutlet UISwitch *duckOtherAppSwitch;
@@ -716,9 +716,9 @@ BOOL isCustomResolution(int resolutionSelected) {
[self addSetting:self.pointerVelocityFactorStack ofId:@"pointerVelocityFactorStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; [self addSetting:self.pointerVelocityFactorStack ofId:@"pointerVelocityFactorStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection];
[self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; [self addSetting:self.mousePointerVelocityStack ofId:@"mousePointerVelocityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection];
[self addSetting:self.singleTapSensitivityStack ofId:@"singleTapSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection]; [self addSetting:self.singleTapSensitivityStack ofId:@"singleTapSensitivityStack" withInfoTag:NO withDynamicLabel:YES to:touchAndControlSection];
[self addSetting:self.delayLeftClickStack ofId:@"delayLeftClickStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection];
[self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection]; [self addSetting:self.onScreenWidgetStack ofId:@"onScreenWidgetStack" withInfoTag:YES withDynamicLabel:YES to:touchAndControlSection];
[self addSetting:self.buttonVisualFeedbackStack ofId:@"buttonVisualFeedbackStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; [self addSetting:self.buttonVisualFeedbackStack ofId:@"buttonVisualFeedbackStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection];
[self addSetting:self.appendLeftClickStack ofId:@"appendLeftClickStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection];
[self addSetting:self.swapAbxyStack ofId:@"swapAbaxyStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; [self addSetting:self.swapAbxyStack ofId:@"swapAbaxyStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection];
[self addSetting:self.hapticEngineStack ofId:@"hapticEngineStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection]; [self addSetting:self.hapticEngineStack ofId:@"hapticEngineStack" withInfoTag:NO withDynamicLabel:NO to:touchAndControlSection];
[self addSetting:self.emulatedControllerTypeStack ofId:@"emulatedControllerTypeStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection]; [self addSetting:self.emulatedControllerTypeStack ofId:@"emulatedControllerTypeStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection];
@@ -1284,8 +1284,8 @@ BOOL isCustomResolution(int resolutionSelected) {
tipText = [LocalizationHelper localizedStringForKey:@"useBuiltinMicStackTip"]; tipText = [LocalizationHelper localizedStringForKey:@"useBuiltinMicStackTip"];
showOnlineDocAction = false; showOnlineDocAction = false;
} }
if([sender.superview.accessibilityIdentifier isEqualToString: @"appendLeftClickStack"]){ if([sender.superview.accessibilityIdentifier isEqualToString: @"delayLeftClickStack"]){
tipText = [LocalizationHelper localizedStringForKey:@"appendLeftClickStackTip"]; tipText = [LocalizationHelper localizedStringForKey:@"delayLeftClickStackTip"];
showOnlineDocAction = false; showOnlineDocAction = false;
} }
@@ -1680,7 +1680,7 @@ BOOL isCustomResolution(int resolutionSelected) {
[self.multiControllerSwitch setOn:self->tempSettings.multiController]; [self.multiControllerSwitch setOn:self->tempSettings.multiController];
[self.swapAbxySwitch setOn:self->tempSettings.swapABXYButtons]; [self.swapAbxySwitch setOn:self->tempSettings.swapABXYButtons];
[self.buttonVisualFeedbackSwitch setOn:self->tempSettings.buttonVisualFeedback]; [self.buttonVisualFeedbackSwitch setOn:self->tempSettings.buttonVisualFeedback];
[self.appendLeftClickSwitch setOn:self->tempSettings.appendLeftClick]; [self.delayLeftClickSwitch setOn:self->tempSettings.delayLeftClick];
[self.hapticEngineSelector setSelectedSegmentIndex:self->tempSettings.hapticEngine.intValue]; [self.hapticEngineSelector setSelectedSegmentIndex:self->tempSettings.hapticEngine.intValue];
bool hideHapticEngineStack = false; bool hideHapticEngineStack = false;
@@ -2333,12 +2333,11 @@ BOOL isCustomResolution(int resolutionSelected) {
[self setHidden:!isNativeTouch forStack:self.pointerVelocityDividerStack]; [self setHidden:!isNativeTouch forStack:self.pointerVelocityDividerStack];
[self setHidden:!isNativeTouch forStack:self.pointerVelocityFactorStack]; [self setHidden:!isNativeTouch forStack:self.pointerVelocityFactorStack];
[self setHidden:!(sender.selectedSegmentIndex == RelativeTouch) forStack:self.mousePointerVelocityStack]; [self setHidden:sender.selectedSegmentIndex!=RelativeTouch forStack:self.mousePointerVelocityStack];
[self setHidden:!(sender.selectedSegmentIndex == RelativeTouch) forStack:self.singleTapSensitivityStack]; [self setHidden:sender.selectedSegmentIndex!=RelativeTouch forStack:self.singleTapSensitivityStack];
[self setHidden:![self isNotNativeTouchOnly] forStack:self.onScreenWidgetStack]; [self setHidden:![self isNotNativeTouchOnly] forStack:self.onScreenWidgetStack];
[self setHidden:![self isNotNativeTouchOnly] forStack:self.buttonVisualFeedbackStack]; [self setHidden:![self isNotNativeTouchOnly] forStack:self.buttonVisualFeedbackStack];
[self setHidden:!(([self isNotNativeTouchOnly] && sender.selectedSegmentIndex == NativeTouch) [self setHidden:sender.selectedSegmentIndex!=AbsoluteTouch forStack:self.delayLeftClickStack];
|| sender.selectedSegmentIndex == AbsoluteTouch) forStack:self.appendLeftClickStack];
[self handleOswGestureChange]; [self handleOswGestureChange];
} }
@@ -2411,7 +2410,6 @@ BOOL isCustomResolution(int resolutionSelected) {
- (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{ - (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{
[self setHidden:!sender.isOn forStack:self.onScreenWidgetStack]; [self setHidden:!sender.isOn forStack:self.onScreenWidgetStack];
[self setHidden:!sender.isOn forStack:self.buttonVisualFeedbackStack]; [self setHidden:!sender.isOn forStack:self.buttonVisualFeedbackStack];
[self setHidden:!sender.isOn forStack:self.appendLeftClickStack];
[self handleOswGestureChange]; [self handleOswGestureChange];
} }
@@ -2881,7 +2879,7 @@ BOOL isCustomResolution(int resolutionSelected) {
NSInteger hapticEngine = self.hapticEngineSelector.selectedSegmentIndex; NSInteger hapticEngine = self.hapticEngineSelector.selectedSegmentIndex;
CGFloat edgeSlidingSensitivity = self.edgeSlidingSensitivitySlider.value; CGFloat edgeSlidingSensitivity = self.edgeSlidingSensitivitySlider.value;
NSInteger audioEngine = self.audioEngineSelector.selectedSegmentIndex; NSInteger audioEngine = self.audioEngineSelector.selectedSegmentIndex;
BOOL appendLeftClick = self.appendLeftClickSwitch.isOn; BOOL delayLeftClick = self.delayLeftClickSwitch.isOn;
BOOL duckOtherApps = self.duckOtherAppSwitch.isOn; BOOL duckOtherApps = self.duckOtherAppSwitch.isOn;
BOOL muteInBackground = self.muteInBackgroundSwitch.isOn; BOOL muteInBackground = self.muteInBackgroundSwitch.isOn;
NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value; NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value;
@@ -2939,7 +2937,7 @@ BOOL isCustomResolution(int resolutionSelected) {
hapticEngine:hapticEngine hapticEngine:hapticEngine
edgeSlidingSensitivity:edgeSlidingSensitivity edgeSlidingSensitivity:edgeSlidingSensitivity
audioEngine:audioEngine audioEngine:audioEngine
appendLeftClick:appendLeftClick delayLeftClick:delayLeftClick
duckOtherApps:duckOtherApps duckOtherApps:duckOtherApps
muteInBackground:muteInBackground muteInBackground:muteInBackground
backgroundSessionTimer:backgroundSessionTimer]; backgroundSessionTimer:backgroundSessionTimer];
+5 -5
View File
@@ -560,31 +560,31 @@
} }
}, },
"9Yx-H8-E3N.text" : { "9Yx-H8-E3N.text" : {
"comment" : "Class = \"UILabel\"; text = \"Additional Left Click\"; ObjectID = \"9Yx-H8-E3N\";", "comment" : "Class = \"UILabel\"; text = \"Delay Left Click\"; ObjectID = \"9Yx-H8-E3N\";",
"extractionState" : "extracted_with_value", "extractionState" : "extracted_with_value",
"localizations" : { "localizations" : {
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "new", "state" : "new",
"value" : "Additional Left Click" "value" : "Delay Left Click"
} }
}, },
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加鼠标左单击" "value" : "延迟鼠标左单击"
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加滑鼠左單擊" "value" : "延遲滑鼠左單擊"
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加滑鼠左單擊" "value" : "延遲滑鼠左單擊"
} }
} }
} }
+5 -5
View File
@@ -3542,31 +3542,31 @@
} }
}, },
"qOa-te-sPj.text" : { "qOa-te-sPj.text" : {
"comment" : "Class = \"UILabel\"; text = \"Additional Left Click\"; ObjectID = \"qOa-te-sPj\";", "comment" : "Class = \"UILabel\"; text = \"Delay Left Click\"; ObjectID = \"qOa-te-sPj\";",
"extractionState" : "extracted_with_value", "extractionState" : "extracted_with_value",
"localizations" : { "localizations" : {
"en" : { "en" : {
"stringUnit" : { "stringUnit" : {
"state" : "new", "state" : "new",
"value" : "Additional Left Click" "value" : "Delay Left Click"
} }
}, },
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加鼠标左单击" "value" : "延迟鼠标左单击"
} }
}, },
"zh-Hant" : { "zh-Hant" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加滑鼠左單擊" "value" : "延遲滑鼠左單擊"
} }
}, },
"zh-HK" : { "zh-HK" : {
"stringUnit" : { "stringUnit" : {
"state" : "needs_review", "state" : "needs_review",
"value" : "追加滑鼠左單擊" "value" : "延遲滑鼠左單擊"
} }
} }
} }