add disable hovering switch
This commit is contained in:
1 parent
dadb292676
commit
2bc18e2f02
6 files changed
+28
-27
No files matched your search
@@ -2089,16 +2089,16 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
</stackView>
|
</stackView>
|
||||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="OBt-d7-mew">
|
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="OBt-d7-mew">
|
||||||
<rect key="frame" x="3145" y="426" width="268.5" height="31"/>
|
<rect key="frame" x="3145" y="426" width="279.5" height="31"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto End Hover" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="q78-aY-mIe" userLabel="uiLabel">
|
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disable Hovering" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="q78-aY-mIe" userLabel="uiLabel">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="118.5" height="31"/>
|
<rect key="frame" x="0.0" y="0.0" width="129.5" 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="hOj-4u-Swl">
|
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hOj-4u-Swl">
|
||||||
<rect key="frame" x="138.5" y="0.0" width="132" height="31"/>
|
<rect key="frame" x="149.5" y="0.0" width="132" height="31"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="130" id="Akr-jH-mSd"/>
|
<constraint firstAttribute="width" constant="130" id="Akr-jH-mSd"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
|
|||||||
@@ -157,9 +157,9 @@
|
|||||||
forKey:@"squeezeEndShortcut"]
|
forKey:@"squeezeEndShortcut"]
|
||||||
: @"";
|
: @"";
|
||||||
|
|
||||||
self.autoPencilHoverTermination = [decoder containsValueForKey:@"autoPencilHoverTermination"] ? [decoder decodeBoolForKey:@"autoPencilHoverTermination"] : true;
|
|
||||||
self.pencilPausesNativeTouch = [decoder containsValueForKey:@"pencilPausesNativeTouch"] ? [decoder decodeBoolForKey:@"pencilPausesNativeTouch"] : false;
|
self.pencilPausesNativeTouch = [decoder containsValueForKey:@"pencilPausesNativeTouch"] ? [decoder decodeBoolForKey:@"pencilPausesNativeTouch"] : false;
|
||||||
self.disablePencilSlideGestures = [decoder containsValueForKey:@"disablePencilSlideGestures"] ? [decoder decodeBoolForKey:@"disablePencilSlideGestures"] : false;
|
self.disablePencilSlideGestures = [decoder containsValueForKey:@"disablePencilSlideGestures"] ? [decoder decodeBoolForKey:@"disablePencilSlideGestures"] : false;
|
||||||
|
self.autoPencilHoverTermination = [decoder containsValueForKey:@"autoPencilHoverTermination"] ? [decoder decodeBoolForKey:@"autoPencilHoverTermination"] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
@@ -199,6 +199,7 @@
|
|||||||
copy.squeezeEndShortcut = [self.squeezeEndShortcut mutableCopy]; // NSString → NSMutableString
|
copy.squeezeEndShortcut = [self.squeezeEndShortcut mutableCopy]; // NSString → NSMutableString
|
||||||
copy.pencilPausesNativeTouch = self.pencilPausesNativeTouch;
|
copy.pencilPausesNativeTouch = self.pencilPausesNativeTouch;
|
||||||
copy.disablePencilSlideGestures = self.disablePencilSlideGestures;
|
copy.disablePencilSlideGestures = self.disablePencilSlideGestures;
|
||||||
|
copy.autoPencilHoverTermination = self.autoPencilHoverTermination;
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import UIKit
|
|||||||
private var pencilTickEnabled: Bool
|
private var pencilTickEnabled: Bool
|
||||||
private var pressureCurveEnabled: Bool = false
|
private var pressureCurveEnabled: Bool = false
|
||||||
private var manualHoverFlag: Bool = false
|
private var manualHoverFlag: Bool = false
|
||||||
@objc static var autoHoverTerminationEnabled: Bool = true
|
@objc static var hoverSupported: Bool = false
|
||||||
|
@objc static private(set) var autoHoverTermination: Bool = false
|
||||||
private(set) var pencilProEnabled: Bool = false
|
private(set) var pencilProEnabled: Bool = false
|
||||||
private var isFirstMove: Bool = false
|
private var isFirstMove: Bool = false
|
||||||
private var moveEventIndex: Int64 = 0
|
private var moveEventIndex: Int64 = 0
|
||||||
@@ -77,7 +78,7 @@ import UIKit
|
|||||||
print("squeezeShorcutEnabled \(CACurrentMediaTime())")
|
print("squeezeShorcutEnabled \(CACurrentMediaTime())")
|
||||||
}
|
}
|
||||||
|
|
||||||
// PencilHandler.autoHoverTerminationEnabled = selectedProfile.autoPencilHoverTermination
|
PencilHandler.autoHoverTermination = selectedProfile.autoPencilHoverTermination
|
||||||
|
|
||||||
pressureCurveEnabled = selectedProfile.pressureCurveEnabled
|
pressureCurveEnabled = selectedProfile.pressureCurveEnabled
|
||||||
|
|
||||||
@@ -226,7 +227,7 @@ import UIKit
|
|||||||
eventType = UInt8(LI_TOUCH_EVENT_MOVE)
|
eventType = UInt8(LI_TOUCH_EVENT_MOVE)
|
||||||
}
|
}
|
||||||
|
|
||||||
delay = manualTick ? 0.0086 : 0.017
|
delay = manualTick ? 0.0086 : 0
|
||||||
delay = eventType == UInt8(LI_TOUCH_EVENT_UP) ? delay : 0
|
delay = eventType == UInt8(LI_TOUCH_EVENT_UP) ? delay : 0
|
||||||
|
|
||||||
if previousTimeStamp == 0 {
|
if previousTimeStamp == 0 {
|
||||||
@@ -251,9 +252,8 @@ import UIKit
|
|||||||
|
|
||||||
if eventType == UInt8(LI_TOUCH_EVENT_UP) {
|
if eventType == UInt8(LI_TOUCH_EVENT_UP) {
|
||||||
PencilHandler.isDrawing = false
|
PencilHandler.isDrawing = false
|
||||||
LiSendPenEvent(UInt8(LI_TOUCH_EVENT_HOVER), UInt8(LI_TOOL_TYPE_PEN), 0, Float(normalizedLocation.x), Float(normalizedLocation.y), 0, 0, 0, self.getRotation(fromAzimuthAngle: Float(azimuth)), self.getTilt(fromAltitudeAngle: Float(altitude)))
|
if PencilHandler.autoHoverTermination || !PencilHandler.hoverSupported {
|
||||||
|
LiSendPenEvent(UInt8(LI_TOUCH_EVENT_HOVER), UInt8(LI_TOOL_TYPE_PEN), 0, Float(normalizedLocation.x), Float(normalizedLocation.y), 0, 0, 0, self.getRotation(fromAzimuthAngle: Float(azimuth)), self.getTilt(fromAltitudeAngle: Float(altitude)))
|
||||||
if PencilHandler.autoHoverTerminationEnabled {
|
|
||||||
DispatchQueue.global().asyncAfter(deadline: .now() + 0.0086){
|
DispatchQueue.global().asyncAfter(deadline: .now() + 0.0086){
|
||||||
if !PencilHandler.isDrawing {
|
if !PencilHandler.isDrawing {
|
||||||
LiSendPenEvent(UInt8(LI_TOUCH_EVENT_HOVER_LEAVE), UInt8(LI_TOOL_TYPE_PEN), 0, Float(normalizedLocation.x), Float(normalizedLocation.y), 0, 0, 0, self.getRotation(fromAzimuthAngle: Float(azimuth)), self.getTilt(fromAltitudeAngle: Float(altitude)))
|
LiSendPenEvent(UInt8(LI_TOUCH_EVENT_HOVER_LEAVE), UInt8(LI_TOOL_TYPE_PEN), 0, Float(normalizedLocation.x), Float(normalizedLocation.y), 0, 0, 0, self.getRotation(fromAzimuthAngle: Float(azimuth)), self.getTilt(fromAltitudeAngle: Float(altitude)))
|
||||||
|
|||||||
@@ -785,7 +785,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
CGPoint location = [self adjustCoordinatesForVideoArea:[event locationInView:self]];
|
CGPoint location = [self adjustCoordinatesForVideoArea:[event locationInView:self]];
|
||||||
CGSize videoSize = [self getVideoAreaSize];
|
CGSize videoSize = [self getVideoAreaSize];
|
||||||
|
|
||||||
CGFloat pressure = (event.force / event.maximumPossibleForce) / sin(event.altitudeAngle);
|
// CGFloat pressure = (event.force / event.maximumPossibleForce) / sin(event.altitudeAngle);
|
||||||
|
|
||||||
return LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
return LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
||||||
(event.force / event.maximumPossibleForce) / sin(event.altitudeAngle),
|
(event.force / event.maximumPossibleForce) / sin(event.altitudeAngle),
|
||||||
@@ -802,7 +802,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
case UIGestureRecognizerStateChanged:
|
case UIGestureRecognizerStateChanged:
|
||||||
type = LI_TOUCH_EVENT_HOVER;
|
type = LI_TOUCH_EVENT_HOVER;
|
||||||
isPencilHovering = true;
|
isPencilHovering = true;
|
||||||
if(PencilHandler.autoHoverTerminationEnabled) PencilHandler.autoHoverTerminationEnabled = false;
|
if(!PencilHandler.hoverSupported) PencilHandler.hoverSupported = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UIGestureRecognizerStateEnded:
|
case UIGestureRecognizerStateEnded:
|
||||||
@@ -813,7 +813,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(gesture.state==UIGestureRecognizerStateEnded){
|
if(gesture.state==UIGestureRecognizerStateEnded){
|
||||||
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.016 * NSEC_PER_SEC));
|
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.008 * NSEC_PER_SEC));
|
||||||
dispatch_after(delayTime, dispatch_get_main_queue(), ^{// Code to execute after the delay
|
dispatch_after(delayTime, dispatch_get_main_queue(), ^{// Code to execute after the delay
|
||||||
self->isPencilHovering = false;
|
self->isPencilHovering = false;
|
||||||
});
|
});
|
||||||
@@ -838,7 +838,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
if(!PencilHandler.autoHoverTermination) LiSendPenEvent(type, LI_TOOL_TYPE_PEN, 0, location.x / videoSize.width, location.y / videoSize.height,
|
||||||
distance, 0.0f, 0.0f, rotationAngle, tiltAngle);
|
distance, 0.0f, 0.0f, rotationAngle, tiltAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self.squeezeShortcutSwitch setOn:oscProfile.squeezeShorcutEnabled];
|
[self.squeezeShortcutSwitch setOn:oscProfile.squeezeShorcutEnabled];
|
||||||
[self.pencilPausesNativeTouchSwitch setOn:oscProfile.pencilPausesNativeTouch];
|
[self.pencilPausesNativeTouchSwitch setOn:oscProfile.pencilPausesNativeTouch];
|
||||||
[self.disablePencilSlideGestureSwitch setOn:oscProfile.disablePencilSlideGestures];
|
[self.disablePencilSlideGestureSwitch setOn:oscProfile.disablePencilSlideGestures];
|
||||||
// [self.autoHoverTerminationSwitch setOn:oscProfile.autoPencilHoverTermination];
|
[self.autoHoverTerminationSwitch setOn:oscProfile.autoPencilHoverTermination];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)saveGameProfileConfigs{
|
- (void)saveGameProfileConfigs{
|
||||||
@@ -421,7 +421,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
&& oscProfile.squeezeShorcutEnabled == self.squeezeShortcutSwitch.isOn
|
&& oscProfile.squeezeShorcutEnabled == self.squeezeShortcutSwitch.isOn
|
||||||
&& oscProfile.pencilPausesNativeTouch == self.pencilPausesNativeTouchSwitch.isOn
|
&& oscProfile.pencilPausesNativeTouch == self.pencilPausesNativeTouchSwitch.isOn
|
||||||
&& oscProfile.disablePencilSlideGestures == self.disablePencilSlideGestureSwitch.isOn
|
&& oscProfile.disablePencilSlideGestures == self.disablePencilSlideGestureSwitch.isOn
|
||||||
// && oscProfile.autoPencilHoverTermination == self.autoHoverTerminationSwitch.isOn
|
&& oscProfile.autoPencilHoverTermination == self.autoHoverTerminationSwitch.isOn
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!configNotChanged){
|
if(!configNotChanged){
|
||||||
@@ -443,7 +443,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
oscProfile.squeezeShorcutEnabled = self.squeezeShortcutSwitch.isOn;
|
oscProfile.squeezeShorcutEnabled = self.squeezeShortcutSwitch.isOn;
|
||||||
oscProfile.pencilPausesNativeTouch = self.pencilPausesNativeTouchSwitch.isOn;
|
oscProfile.pencilPausesNativeTouch = self.pencilPausesNativeTouchSwitch.isOn;
|
||||||
oscProfile.disablePencilSlideGestures = self.disablePencilSlideGestureSwitch.isOn;
|
oscProfile.disablePencilSlideGestures = self.disablePencilSlideGestureSwitch.isOn;
|
||||||
// oscProfile.autoPencilHoverTermination = self.autoHoverTerminationSwitch.isOn;
|
oscProfile.autoPencilHoverTermination = self.autoHoverTerminationSwitch.isOn;
|
||||||
[oscProfileMan replaceSelectedProfileWith:oscProfile overwriteDefault:YES];
|
[oscProfileMan replaceSelectedProfileWith:oscProfile overwriteDefault:YES];
|
||||||
if(PencilHandler.shared) [PencilHandler.shared setupPressureLUTWithProfile:oscProfile];
|
if(PencilHandler.shared) [PencilHandler.shared setupPressureLUTWithProfile:oscProfile];
|
||||||
}
|
}
|
||||||
@@ -889,7 +889,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[self addSetting:self.pressureCurveStack ofId:@"pressureCurveStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.pressureCurveStack ofId:@"pressureCurveStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
||||||
[self addSetting:self.doubleTapShortcutStack ofId:@"doubleTapShortcutStack" withInfoTag:YES withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.doubleTapShortcutStack ofId:@"doubleTapShortcutStack" withInfoTag:YES withDynamicLabel:NO to:pencilSection];
|
||||||
[self addSetting:self.squeezeShortcutStack ofId:@"squeezeShortcutStack" withInfoTag:YES withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.squeezeShortcutStack ofId:@"squeezeShortcutStack" withInfoTag:YES withDynamicLabel:NO to:pencilSection];
|
||||||
// [self addSetting:self.autoHoverTerminationStack ofId:@"autoHoverTerminationStack" withInfoTag:YES withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.autoHoverTerminationStack ofId:@"autoHoverTerminationStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
||||||
[self addSetting:self.pencilPausesNativeTouchStack ofId:@"pencilPausesNativeTouchStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.pencilPausesNativeTouchStack ofId:@"pencilPausesNativeTouchStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
||||||
[self addSetting:self.disablePencilSlideGestureStack ofId:@"disablePencilSlideGestureStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
[self addSetting:self.disablePencilSlideGestureStack ofId:@"disablePencilSlideGestureStack" withInfoTag:NO withDynamicLabel:NO to:pencilSection];
|
||||||
[pencilSection addToParentStack:_parentStack];
|
[pencilSection addToParentStack:_parentStack];
|
||||||
|
|||||||
@@ -4748,31 +4748,31 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"q78-aY-mIe.text" : {
|
"q78-aY-mIe.text" : {
|
||||||
"comment" : "Class = \"UILabel\"; text = \"Auto End Hover\"; ObjectID = \"q78-aY-mIe\";",
|
"comment" : "Class = \"UILabel\"; text = \"Disable Hovering\"; ObjectID = \"q78-aY-mIe\";",
|
||||||
"extractionState" : "extracted_with_value",
|
"extractionState" : "extracted_with_value",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"en" : {
|
"en" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "new",
|
"state" : "new",
|
||||||
"value" : "Auto End Hover"
|
"value" : "Disable Hovering"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-Hans" : {
|
"zh-Hans" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "needs_review",
|
"state" : "translated",
|
||||||
"value" : "自动停止悬停"
|
"value" : "关闭悬停"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-Hant" : {
|
"zh-Hant" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "needs_review",
|
"state" : "translated",
|
||||||
"value" : "自動停止懸停"
|
"value" : "關閉懸停"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "needs_review",
|
"state" : "translated",
|
||||||
"value" : "自動停止懸停"
|
"value" : "關閉懸停"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user