feat: append mouse left click after touch up as an option for OSRS (Old School RuneScape) or similar games that requires double tap on touchscreen
This commit is contained in:
@@ -1360,16 +1360,16 @@
|
||||
</constraints>
|
||||
</stackView>
|
||||
<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="600" height="55.5"/>
|
||||
<rect key="frame" x="440" y="307" width="668" height="55.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="20.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="668" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</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">
|
||||
<rect key="frame" x="-2" y="25.5" width="604" height="31"/>
|
||||
<rect key="frame" x="-2" y="25.5" width="672" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="qOF-42-hPO"/>
|
||||
</constraints>
|
||||
@@ -1474,6 +1474,26 @@
|
||||
<constraint firstAttribute="width" constant="380" id="Pmq-z6-IVL"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<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"/>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="151.5" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<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"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="ouQ-r6-6Ix"/>
|
||||
</constraints>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="31" id="m8h-w7-JRF"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
@@ -1481,6 +1501,8 @@
|
||||
<connections>
|
||||
<outlet property="appThemeSelector" destination="wi6-L4-KwS" id="mf9-YY-eyE"/>
|
||||
<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="audioConfigStack" destination="qnG-5F-2YY" id="kFX-VK-vuK"/>
|
||||
<outlet property="audioEngineSelector" destination="85A-d5-pLE" id="Ads-EZ-Bpm"/>
|
||||
@@ -2377,7 +2399,7 @@
|
||||
<image name="tray.full.fill" catalog="system" width="128" height="88"/>
|
||||
<image name="video.and.waveform" catalog="system" width="128" height="94"/>
|
||||
<systemColor name="linkColor">
|
||||
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="secondarySystemGroupedBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
@@ -2386,13 +2408,13 @@
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemBrownColor">
|
||||
<color red="0.63529411764705879" green="0.51764705882352946" blue="0.36862745098039218" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemGray3Color">
|
||||
<color red="0.7803921568627451" green="0.7803921568627451" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color red="0.78039215689999997" green="0.78039215689999997" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemTealColor">
|
||||
<color red="0.18823529411764706" green="0.69019607843137254" blue="0.7803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<color red="0.18823529410000001" green="0.69019607839999997" blue="0.78039215689999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -2214,16 +2214,16 @@
|
||||
</constraints>
|
||||
</stackView>
|
||||
<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="396" height="55.5"/>
|
||||
<rect key="frame" x="437" y="2383" width="412" height="55.5"/>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="396" height="20.5"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="412" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</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">
|
||||
<rect key="frame" x="-2" y="25.5" width="400" height="31"/>
|
||||
<rect key="frame" x="-2" y="25.5" width="416" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="XXP-GP-uhn"/>
|
||||
</constraints>
|
||||
@@ -2257,6 +2257,26 @@
|
||||
<constraint firstAttribute="width" constant="380" id="omg-6c-jr3"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<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"/>
|
||||
<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">
|
||||
<rect key="frame" x="0.0" y="0.0" width="151.5" height="31"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<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"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="Lry-88-Pdv"/>
|
||||
</constraints>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="31" id="Ak8-3f-rpG"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
@@ -2264,6 +2284,8 @@
|
||||
<connections>
|
||||
<outlet property="appThemeSelector" destination="pNz-vd-Sr9" id="nYB-7o-wkT"/>
|
||||
<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="audioConfigStack" destination="Rld-CY-qzs" id="dmf-m8-sor"/>
|
||||
<outlet property="audioEngineSelector" destination="pVq-EW-Dta" id="fcu-q8-UNI"/>
|
||||
|
||||
@@ -126,6 +126,7 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) {
|
||||
hapticEngine:(NSInteger)hapticEngine
|
||||
edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity
|
||||
audioEngine:(NSInteger)audioEngine
|
||||
appendLeftClick:(BOOL)appendLeftClick
|
||||
backgroundSessionTimer:(NSInteger)backgroundSessionTimer;
|
||||
|
||||
- (NSArray*) getHosts;
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
hapticEngine:(NSInteger)hapticEngine
|
||||
edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity
|
||||
audioEngine:(NSInteger)audioEngine
|
||||
appendLeftClick:(BOOL)appendLeftClick
|
||||
backgroundSessionTimer:(NSInteger)backgroundSessionTimer{
|
||||
|
||||
[_managedObjectContext performBlockAndWait:^{
|
||||
@@ -168,6 +169,7 @@
|
||||
settingsToSave.hapticEngine = [NSNumber numberWithInteger:hapticEngine];
|
||||
settingsToSave.edgeSlidingSensitivity = [NSNumber numberWithFloat:edgeSlidingSensitivity];
|
||||
settingsToSave.audioEngine = [NSNumber numberWithInteger:audioEngine];
|
||||
settingsToSave.appendLeftClick = appendLeftClick;
|
||||
settingsToSave.rememberFoldState = rememberFoldState;
|
||||
[self saveData];
|
||||
}];
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
@property (nonatomic, retain) NSNumber * appTheme;
|
||||
@property (nonatomic, retain) NSNumber * edgeSlidingSensitivity;
|
||||
@property (nonatomic, retain) NSNumber * audioEngine;
|
||||
@property (nonatomic) BOOL appendLeftClick;
|
||||
@property (nonatomic, retain) NSNumber * framePacingMode;
|
||||
|
||||
- (id) initFromSettings:(Settings*)settings;
|
||||
|
||||
@@ -140,6 +140,7 @@
|
||||
self.hapticEngine = settings.hapticEngine;
|
||||
self.uniqueId = settings.uniqueId;
|
||||
self.audioEngine = settings.audioEngine;
|
||||
self.appendLeftClick = settings.appendLeftClick;
|
||||
#endif
|
||||
|
||||
return self;
|
||||
|
||||
@@ -39,12 +39,16 @@
|
||||
CGFloat slideGestureVerticalThreshold;
|
||||
CGFloat screenWidthWithThreshold;
|
||||
CGFloat _edgeTolerance;
|
||||
|
||||
bool _appendMouseLeftClick;
|
||||
}
|
||||
|
||||
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings {
|
||||
self = [self init];
|
||||
self->streamView = view;
|
||||
|
||||
_appendMouseLeftClick = settings.appendLeftClick;
|
||||
|
||||
// upper screen check
|
||||
_edgeTolerance = settings.edgeSlidingSensitivity.floatValue;
|
||||
slideGestureVerticalThreshold = CGRectGetHeight([[UIScreen mainScreen] bounds]) * 0.4;
|
||||
@@ -140,6 +144,8 @@
|
||||
// Remember this last touch for touch-down deadzoning
|
||||
lastTouchUp = [touches anyObject];
|
||||
lastTouchUpLocation = [lastTouchUp locationInView:streamView];
|
||||
|
||||
if(_appendMouseLeftClick && [self touchDidntMoveOnScreen:lastTouchUp]) [self sendShortMouseLeftButtonClickEvent];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,4 +154,25 @@
|
||||
[self touchesEnded:touches withEvent:event];
|
||||
}
|
||||
|
||||
- (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{
|
||||
return [self isAdjacentPoints:[touch locationInView:streamView] from:lastTouchDownLocation 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
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
@implementation NativeTouchHandler {
|
||||
StreamView* streamView;
|
||||
TemporarySettings* currentSettings;
|
||||
bool activateCoordSelector;
|
||||
CGFloat pointerVelocityDividerLocationByPoints;
|
||||
|
||||
bool asyncNativeTouch;
|
||||
@@ -43,13 +42,14 @@
|
||||
CGRect streamViewBounds;
|
||||
|
||||
int64_t moveEventIntervalNSec;
|
||||
|
||||
bool _appendMouseLeftClick;
|
||||
}
|
||||
|
||||
- (id)initWithView:(StreamView*)view andSettings:(TemporarySettings*)settings{
|
||||
self = [super init];
|
||||
self->streamView = view;
|
||||
self->currentSettings = settings;
|
||||
self->activateCoordSelector = currentSettings.pointerVelocityModeDivider.floatValue != 1.0;
|
||||
self->moveEventIntervalNSec = (int64_t)(currentSettings.touchMoveEventInterval.intValue * 1000);;
|
||||
self->streamViewBounds = view.bounds;
|
||||
|
||||
@@ -60,7 +60,9 @@
|
||||
}
|
||||
self->activePointerIds = [NSMutableSet set];
|
||||
self->blacklistedTouches = [NSMutableSet set];
|
||||
|
||||
|
||||
_appendMouseLeftClick = settings.appendLeftClick;
|
||||
|
||||
self->asyncNativeTouch = settings.asyncNativeTouchPriority.intValue != AsyncNativeTouchOff;
|
||||
|
||||
switch(settings.asyncNativeTouchPriority.intValue){
|
||||
@@ -195,7 +197,7 @@
|
||||
//NSLog(@"selecting coords: %d", touch.phase == UITouchPhaseMoved);
|
||||
// NSLog(@"excluded count: %d", (uint32_t)[excludedPointerIds count]);
|
||||
|
||||
targetCoords = activateCoordSelector ? [self selectCoordsFor:touch] : [touch locationInView:streamView];
|
||||
targetCoords = [self selectCoordsFor:touch];
|
||||
|
||||
CGPoint location = [self adjustCoordinatesForVideoArea:targetCoords];
|
||||
CGSize videoSize = [self getVideoAreaSize];
|
||||
@@ -215,7 +217,7 @@
|
||||
// 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;
|
||||
[self handleTouchDown:touch]; //generate & populate pointerId
|
||||
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
||||
[self populatePointerObjIntoDict:touch];
|
||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
||||
}
|
||||
});
|
||||
@@ -224,7 +226,7 @@
|
||||
// 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;
|
||||
[self handleTouchDown:touch]; //generate & populate pointerId
|
||||
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
||||
[self populatePointerObjIntoDict:touch];
|
||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
||||
}
|
||||
}
|
||||
@@ -234,7 +236,7 @@
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, moveEventIntervalNSec), dispatch_get_main_queue(), ^{
|
||||
for (UITouch* touch in touches){
|
||||
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
|
||||
if(self->activateCoordSelector) [self updatePointerObjInDict:touch];
|
||||
[self updatePointerObjInDict:touch];
|
||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_MOVE];
|
||||
[[self getPointerObjFromDict:touch] doesNeedResetCoords];
|
||||
}
|
||||
@@ -251,8 +253,11 @@
|
||||
}
|
||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId
|
||||
[self removePointerId:touch]; //then remove pointerId
|
||||
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
||||
[self->blacklistedTouches removeObject:@((uintptr_t)touch)];
|
||||
|
||||
if(self->_appendMouseLeftClick && [self touchDidntMoveOnScreen:touch]) [self sendShortMouseLeftButtonClickEvent];
|
||||
[self removePointerObjFromDict:touch];
|
||||
|
||||
[self->blacklistedTouches removeObject:touchAddrObj];
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -261,7 +266,6 @@
|
||||
[self touchesEnded:touches withEvent:event];
|
||||
}
|
||||
|
||||
|
||||
- (void)populatePointerObjIntoDict:(UITouch*)touch{
|
||||
NativeTouchPointer* pointer = [[NativeTouchPointer alloc] initWithTouch:touch];
|
||||
pointer.useRelativeCoords = pointer.initialPoint.x > pointerVelocityDividerLocationByPoints;
|
||||
@@ -290,4 +294,25 @@
|
||||
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
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<relationship name="appList" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="App" inverseName="host" inverseEntity="App" syncable="YES"/>
|
||||
</entity>
|
||||
<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="asyncNativeTouchPriority" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="audioConfig" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/>
|
||||
|
||||
@@ -766,6 +766,35 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"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" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
|
||||
@@ -181,6 +181,8 @@
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *audioEngineStack;
|
||||
@property (strong, nonatomic) IBOutlet UISegmentedControl *audioEngineSelector;
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *appendLeftClickStack;
|
||||
@property (strong, nonatomic) IBOutlet UISwitch *appendLeftClickSwitch;
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UIStackView *testStack;
|
||||
|
||||
|
||||
@@ -718,6 +718,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self addSetting:self.singleTapSensitivityStack ofId:@"singleTapSensitivityStack" withInfoTag:NO 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.appendLeftClickStack ofId:@"appendLeftClickStack" withInfoTag:YES 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.emulatedControllerTypeStack ofId:@"emulatedControllerTypeStack" withInfoTag:YES withDynamicLabel:NO to:touchAndControlSection];
|
||||
@@ -1281,6 +1282,10 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
tipText = [LocalizationHelper localizedStringForKey:@"useBuiltinMicStackTip"];
|
||||
showOnlineDocAction = false;
|
||||
}
|
||||
if([sender.superview.accessibilityIdentifier isEqualToString: @"appendLeftClickStack"]){
|
||||
tipText = [LocalizationHelper localizedStringForKey:@"appendLeftClickStackTip"];
|
||||
showOnlineDocAction = false;
|
||||
}
|
||||
|
||||
UIAlertController *tipsAlertController = [UIAlertController alertControllerWithTitle: [LocalizationHelper localizedStringForKey:@"Tips"] message:tipText preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
@@ -1673,7 +1678,8 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self.multiControllerSwitch setOn:self->tempSettings.multiController];
|
||||
[self.swapAbxySwitch setOn:self->tempSettings.swapABXYButtons];
|
||||
[self.buttonVisualFeedbackSwitch setOn:self->tempSettings.buttonVisualFeedback];
|
||||
|
||||
[self.appendLeftClickSwitch setOn:self->tempSettings.appendLeftClick];
|
||||
|
||||
[self.hapticEngineSelector setSelectedSegmentIndex:self->tempSettings.hapticEngine.intValue];
|
||||
bool hideHapticEngineStack = false;
|
||||
if(@available(iOS 13.0, tvOS 13.0, *)) hideHapticEngineStack = false;
|
||||
@@ -2324,6 +2330,8 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self setHidden:!(sender.selectedSegmentIndex == RelativeTouch) forStack:self.singleTapSensitivityStack];
|
||||
[self setHidden:![self isNotNativeTouchOnly] forStack:self.onScreenWidgetStack];
|
||||
[self setHidden:![self isNotNativeTouchOnly] forStack:self.buttonVisualFeedbackStack];
|
||||
[self setHidden:!(([self isNotNativeTouchOnly] && sender.selectedSegmentIndex == NativeTouch)
|
||||
|| sender.selectedSegmentIndex == AbsoluteTouch) forStack:self.appendLeftClickStack];
|
||||
[self handleOswGestureChange];
|
||||
}
|
||||
|
||||
@@ -2392,6 +2400,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
- (void)enableOswForNativeTouchSwitchFlipped:(UISwitch *)sender{
|
||||
[self setHidden:!sender.isOn forStack:self.onScreenWidgetStack];
|
||||
[self setHidden:!sender.isOn forStack:self.buttonVisualFeedbackStack];
|
||||
[self setHidden:!sender.isOn forStack:self.appendLeftClickStack];
|
||||
[self handleOswGestureChange];
|
||||
}
|
||||
|
||||
@@ -2861,6 +2870,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
NSInteger hapticEngine = self.hapticEngineSelector.selectedSegmentIndex;
|
||||
CGFloat edgeSlidingSensitivity = self.edgeSlidingSensitivitySlider.value;
|
||||
NSInteger audioEngine = self.audioEngineSelector.selectedSegmentIndex;
|
||||
BOOL appendLeftClick = self.appendLeftClickSwitch.isOn;
|
||||
NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value;
|
||||
|
||||
[dataMan saveSettingsWithBitrate:_bitrate
|
||||
@@ -2916,6 +2926,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
hapticEngine:hapticEngine
|
||||
edgeSlidingSensitivity:edgeSlidingSensitivity
|
||||
audioEngine:audioEngine
|
||||
appendLeftClick:appendLeftClick
|
||||
backgroundSessionTimer:backgroundSessionTimer];
|
||||
}
|
||||
|
||||
|
||||
@@ -559,6 +559,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"9Yx-H8-E3N.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Additional Left Click\"; ObjectID = \"9Yx-H8-E3N\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Additional Left Click"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加鼠标左单击"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加滑鼠左單擊"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加滑鼠左單擊"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"53H-ST-OtY.segmentTitles[0]" : {
|
||||
"comment" : "Class = \"UISegmentedControl\"; 53H-ST-OtY.segmentTitles[0] = \"Balanced\"; ObjectID = \"53H-ST-OtY\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
|
||||
@@ -3481,6 +3481,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"qOa-te-sPj.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Additional Left Click\"; ObjectID = \"qOa-te-sPj\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Additional Left Click"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加鼠标左单击"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加滑鼠左單擊"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "追加滑鼠左單擊"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"qPQ-U2-aSg.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Alpha\"; ObjectID = \"qPQ-U2-aSg\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
|
||||
Reference in New Issue
Block a user