feat: pencil squeeze shortcut
This commit is contained in:
@@ -2003,16 +2003,16 @@
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="prr-Do-Nna">
|
||||
<rect key="frame" x="3145" y="270" width="300.5" height="31"/>
|
||||
<rect key="frame" x="3145" y="270" width="306.5" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Double Tap Shorcut" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="v5f-j3-pEc" userLabel="uiLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="150.5" height="31"/>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Double Tap Shortcut" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="v5f-j3-pEc" userLabel="uiLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="156.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="cw7-Jc-7bZ">
|
||||
<rect key="frame" x="170.5" y="0.0" width="132" height="31"/>
|
||||
<rect key="frame" x="176.5" y="0.0" width="132" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="zQj-YX-sHL"/>
|
||||
</constraints>
|
||||
@@ -2022,8 +2022,28 @@
|
||||
<constraint firstAttribute="height" constant="31" id="BW8-EB-nuy"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="KFC-7x-FCI">
|
||||
<rect key="frame" x="3145" y="309" width="286.5" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Squeeze Shortcut" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ccv-UD-RYW" userLabel="uiLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="136.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="VCg-Es-PQV">
|
||||
<rect key="frame" x="156.5" y="0.0" width="132" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="130" id="BdG-yl-Zsi"/>
|
||||
</constraints>
|
||||
</switch>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="31" id="BO4-w4-xg7"/>
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="jLJ-Eo-Zi6">
|
||||
<rect key="frame" x="3145" y="307" width="358.5" height="31"/>
|
||||
<rect key="frame" x="3145" y="348" width="358.5" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Pencil Pauses Native Touch" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hZw-pC-Qxm" userLabel="uiLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="208.5" height="31"/>
|
||||
@@ -2043,7 +2063,7 @@
|
||||
</constraints>
|
||||
</stackView>
|
||||
<stackView verifyAmbiguity="off" opaque="NO" contentMode="scaleToFill" ambiguous="YES" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="dUF-l9-xIV">
|
||||
<rect key="frame" x="3145" y="346" width="362.5" height="31"/>
|
||||
<rect key="frame" x="3145" y="387" width="362.5" height="31"/>
|
||||
<subviews>
|
||||
<label verifyAmbiguity="off" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Disable Pencil Slide Gesture" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.64999997615814209" adjustsLetterSpacingToFitWidth="YES" adjustsFontForContentSizeCategory="YES" translatesAutoresizingMaskIntoConstraints="NO" id="w3d-5s-dH3" userLabel="uiLabel">
|
||||
<rect key="frame" x="0.0" y="0.0" width="212.5" height="31"/>
|
||||
@@ -2229,6 +2249,8 @@
|
||||
<outlet property="softKeyboardGestureStack" destination="Tv6-pw-87l" id="RtJ-Ib-GJg"/>
|
||||
<outlet property="softKeyboardToolbarStack" destination="EKY-6m-OBd" id="B8n-Tm-yrf"/>
|
||||
<outlet property="softKeyboardToolbarSwitch" destination="ztk-Xx-60P" id="A35-6y-cyp"/>
|
||||
<outlet property="squeezeShortcutStack" destination="KFC-7x-FCI" id="p5C-9l-4IV"/>
|
||||
<outlet property="squeezeShortcutSwitch" destination="VCg-Es-PQV" id="kgj-FT-fcZ"/>
|
||||
<outlet property="statsOverlaySelector" destination="NLH-qN-qCo" id="EF8-JF-O3S"/>
|
||||
<outlet property="statsOverlayStack" destination="UcP-0b-nJD" id="UdI-NS-O6k"/>
|
||||
<outlet property="swapAbxyStack" destination="2rP-Ui-wVU" id="gUR-Vz-ORP"/>
|
||||
|
||||
@@ -600,12 +600,26 @@ import UIKit
|
||||
}
|
||||
}
|
||||
|
||||
@objc public func sendAutoReleaseComboCommand(cmdString: [String]?, delay: TimeInterval = 0.2, index: Int = 0) { // we need a large delay for WAN streaming
|
||||
@objc public func sendAutoReleaseComboCommand(cmdString: [String]?, delay: TimeInterval = 0.2, index: Int = 0, pressOnly: Bool = false, releaseOnly:Bool = false) { // we need a large delay for WAN streaming
|
||||
// 如果已处理完所有按键,则开始释放按键
|
||||
guard let cmdString = cmdString else { return }
|
||||
|
||||
if releaseOnly {
|
||||
for keyStr in cmdString.reversed() {
|
||||
if let keyCode = CommandManager.keyboardButtonMappings[keyStr] {
|
||||
LiSendKeyboardEvent(keyCode, Int8(KEY_ACTION_UP), 0) // 释放按键
|
||||
}
|
||||
if let mouseButtonCode = CommandManager.mouseButtonMappings[keyStr]{
|
||||
LiSendMouseButtonEvent(CChar(BUTTON_ACTION_RELEASE), mouseButtonCode)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
guard index < cmdString.count else {
|
||||
// 释放按键
|
||||
DispatchQueue.main.asyncAfter(deadline: .now()) {
|
||||
if pressOnly {return}
|
||||
for keyStr in cmdString.reversed() { // 从后往前释放按键
|
||||
if let keyCode = CommandManager.keyboardButtonMappings[keyStr] {
|
||||
LiSendKeyboardEvent(keyCode, Int8(KEY_ACTION_UP), 0) // 释放按键
|
||||
|
||||
@@ -55,6 +55,9 @@ typedef NS_ENUM(NSInteger, MapGyroTo) {
|
||||
@property (nonatomic, assign) bool doubleTapShorcutEnabled;
|
||||
@property NSString *brushShortcut;
|
||||
@property NSString *eraserShortcut;
|
||||
@property (nonatomic, assign) bool squeezeShorcutEnabled;
|
||||
@property NSString *squeezeStartShortcut;
|
||||
@property NSString *squeezeEndShortcut;
|
||||
@property (nonatomic, assign) bool pencilPausesNativeTouch;
|
||||
@property (nonatomic, assign) bool disablePencilSlideGestures;
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@
|
||||
[encoder encodeBool:self.doubleTapShorcutEnabled forKey:@"doubleTapShorcutEnabled"];
|
||||
[encoder encodeObject:self.brushShortcut forKey:@"brushShortcut"];
|
||||
[encoder encodeObject:self.eraserShortcut forKey:@"eraserShortcut"];
|
||||
[encoder encodeBool:self.squeezeShorcutEnabled forKey:@"squeezeShorcutEnabled"];
|
||||
[encoder encodeObject:self.squeezeStartShortcut forKey:@"squeezeStartShortcut"];
|
||||
[encoder encodeObject:self.squeezeEndShortcut forKey:@"squeezeEndShortcut"];
|
||||
[encoder encodeBool:self.pencilPausesNativeTouch forKey:@"pencilPausesNativeTouch"];
|
||||
[encoder encodeBool:self.disablePencilSlideGestures forKey:@"disablePencilSlideGestures"];
|
||||
}
|
||||
@@ -134,6 +137,25 @@
|
||||
forKey:@"eraserShortcut"]
|
||||
: @"";
|
||||
|
||||
self.squeezeShorcutEnabled = [decoder containsValueForKey:@"squeezeShorcutEnabled"] ? [decoder decodeBoolForKey:@"squeezeShorcutEnabled"] : false;
|
||||
self.squeezeStartShortcut =
|
||||
[decoder containsValueForKey:@"squeezeStartShortcut"]
|
||||
? [decoder decodeObjectOfClasses:
|
||||
[NSSet setWithObjects:
|
||||
[NSString class],
|
||||
nil]
|
||||
forKey:@"squeezeStartShortcut"]
|
||||
: @"";
|
||||
|
||||
self.squeezeEndShortcut =
|
||||
[decoder containsValueForKey:@"squeezeEndShortcut"]
|
||||
? [decoder decodeObjectOfClasses:
|
||||
[NSSet setWithObjects:
|
||||
[NSString class],
|
||||
nil]
|
||||
forKey:@"squeezeEndShortcut"]
|
||||
: @"";
|
||||
|
||||
self.pencilPausesNativeTouch = [decoder containsValueForKey:@"pencilPausesNativeTouch"] ? [decoder decodeBoolForKey:@"pencilPausesNativeTouch"] : false;
|
||||
self.disablePencilSlideGestures = [decoder containsValueForKey:@"disablePencilSlideGestures"] ? [decoder decodeBoolForKey:@"disablePencilSlideGestures"] : false;
|
||||
}
|
||||
@@ -170,6 +192,9 @@
|
||||
copy.doubleTapShorcutEnabled = self.doubleTapShorcutEnabled;
|
||||
copy.brushShortcut = [self.brushShortcut mutableCopy]; // NSString → NSMutableString
|
||||
copy.eraserShortcut = [self.eraserShortcut mutableCopy]; // NSString → NSMutableString
|
||||
copy.squeezeShorcutEnabled = self.squeezeShorcutEnabled;
|
||||
copy.squeezeStartShortcut = [self.squeezeStartShortcut mutableCopy]; // NSString → NSMutableString
|
||||
copy.squeezeEndShortcut = [self.squeezeEndShortcut mutableCopy]; // NSString → NSMutableString
|
||||
copy.pencilPausesNativeTouch = self.pencilPausesNativeTouch;
|
||||
copy.disablePencilSlideGestures = self.disablePencilSlideGestures;
|
||||
return copy;
|
||||
|
||||
@@ -60,6 +60,9 @@ import UIKit
|
||||
doubleTapShorcuts.append(selectedProfile.brushShortcut)
|
||||
}
|
||||
|
||||
PencilHandler.squeezeStartShortcut = selectedProfile.squeezeStartShortcut
|
||||
PencilHandler.squeezeEndShortcut = selectedProfile.squeezeEndShortcut
|
||||
|
||||
pressureCurveEnabled = selectedProfile.pressureCurveEnabled
|
||||
|
||||
if #available(iOS 15.0, *) {
|
||||
@@ -266,10 +269,22 @@ import UIKit
|
||||
_ interaction: UIPencilInteraction,
|
||||
didReceiveSqueeze squeeze: UIPencilInteraction.Squeeze
|
||||
) {
|
||||
if !pencilProEnabled {return}
|
||||
let keepPressedUntilRelease = PencilHandler.squeezeEndShortcut == "NULL"
|
||||
let squeezePressKeyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: PencilHandler.squeezeStartShortcut)
|
||||
let squeezeReleaseKeyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: PencilHandler.squeezeEndShortcut)
|
||||
|
||||
guard let squeezePressKeyStrings = squeezePressKeyStrings else {return}
|
||||
guard squeezePressKeyStrings.count>0 else {return}
|
||||
|
||||
switch squeeze.phase {
|
||||
case .began:
|
||||
if keepPressedUntilRelease {CommandManager.shared.sendAutoReleaseComboCommand(cmdString: squeezePressKeyStrings, delay: 0.1, pressOnly: true)}
|
||||
else {CommandManager.shared.sendAutoReleaseComboCommand(cmdString: squeezePressKeyStrings, delay: 0.1)}
|
||||
break
|
||||
case .ended, .cancelled:
|
||||
if keepPressedUntilRelease {CommandManager.shared.sendAutoReleaseComboCommand(cmdString: squeezePressKeyStrings, releaseOnly: true)}
|
||||
else {CommandManager.shared.sendAutoReleaseComboCommand(cmdString: squeezeReleaseKeyStrings, delay: 0.1)}
|
||||
break
|
||||
default:
|
||||
break
|
||||
@@ -378,9 +393,93 @@ import UIKit
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@objc static private(set) var squeezeStartShortcut:String = ""
|
||||
@objc static private(set) var squeezeEndShortcut:String = ""
|
||||
|
||||
@objc static public func enterSqueezeShortcuts(in viewController: UIViewController){
|
||||
let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero)
|
||||
selectedProfile = oscProfileMan.getSelectedProfile()
|
||||
guard let selectedProfile = selectedProfile else {return}
|
||||
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "enterSqueezePressShort"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: e, ctrl+e, alt+e ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile.squeezeStartShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
squeezeStartShortcut = comboButtons
|
||||
}
|
||||
enterSqueezeEndShortcut(in: viewController)
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
alert.addAction(learnMoreAction)
|
||||
alert.addAction(okAction)
|
||||
|
||||
viewController.present(alert, animated: true, completion: {
|
||||
})
|
||||
}
|
||||
|
||||
@objc static public func enterSqueezeEndShortcut(in viewController: UIViewController){
|
||||
|
||||
let alert = UIAlertController(title: SwiftLocalizationHelper.localizedString(forKey: "Squeeze Shortcut"),
|
||||
message: SwiftLocalizationHelper.localizedString(forKey: "enterSqueezeReleaseShort"),
|
||||
preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { textField in
|
||||
textField.placeholder = SwiftLocalizationHelper.localizedString(forKey:"Example: b, ctrl+b, alt+b ...")
|
||||
textField.keyboardType = .asciiCapable
|
||||
textField.autocorrectionType = .no
|
||||
textField.spellCheckingType = .no
|
||||
textField.text = selectedProfile?.squeezeEndShortcut
|
||||
}
|
||||
|
||||
let okAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "OK"), style: .default) { _ in
|
||||
let comboButtons = alert.textFields?[0].text ?? ""
|
||||
let keyStrings = CommandManager.shared.extractAutoReleaseButtonStrings(from: comboButtons)
|
||||
if keyStrings?.count ?? 0 > 0 || comboButtons == "" {
|
||||
squeezeEndShortcut = comboButtons
|
||||
}
|
||||
|
||||
if selectedProfile?.squeezeEndShortcut != squeezeEndShortcut
|
||||
|| selectedProfile?.squeezeStartShortcut != squeezeStartShortcut {
|
||||
guard let selectedProfile = selectedProfile else {return}
|
||||
let oscProfileMan = OSCProfilesManager.sharedManager(CGRectZero)
|
||||
selectedProfile.squeezeEndShortcut = squeezeEndShortcut
|
||||
selectedProfile.squeezeStartShortcut = squeezeStartShortcut
|
||||
oscProfileMan.replaceSelectedProfile(with: selectedProfile, overwriteDefault: true)
|
||||
}
|
||||
}
|
||||
|
||||
let learnMoreAction = UIAlertAction(title: SwiftLocalizationHelper.localizedString(forKey: "Learn More"), style: .default) { _ in
|
||||
if let url = URL(string: SwiftLocalizationHelper.localizedString(forKey: "pencilKeyboardCmdURL")) {
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||
}
|
||||
}
|
||||
|
||||
alert.addAction(learnMoreAction)
|
||||
alert.addAction(okAction)
|
||||
|
||||
viewController.present(alert, animated: true, completion: {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
private func attachHoverLeave(normalizedLocation:CGPoint){
|
||||
DispatchQueue.global().asyncAfter(deadline: .now()+0.0086) {
|
||||
|
||||
@@ -2477,6 +2477,64 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"enterSqueezePressShort" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Enter shortcut on squeeze Press:"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "输入捏笔时发送的快捷键:"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "輸入捏筆時傳送的快速鍵:"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "輸入捏筆時傳送的快速鍵:"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"enterSqueezeReleaseShort" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Enter shortcut on squeeze release\nIf you want squeeze-press shortcut keys pressed until release, enter 'null':"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "输入松开时发送的快捷键\n如果需要按住捏笔快捷键直到松开,请输入’null’:"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "輸入在鬆開時要發送的快速鍵\n如果需要按住捏筆快速鍵直到鬆開,請輸入 “null”:"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "輸入在鬆開時要發送的快速鍵\n如果需要按住捏筆快速鍵直到鬆開,請輸入 “null”:"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Eraser Shortcut" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
@@ -7051,6 +7109,58 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"Squeeze Shortcut" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏笔快捷键"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏筆快速鍵"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏筆快速鍵"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"squeezeShortcutStackTip" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Shortcut on squeeze press: %@\nShortcut on squeeze release: %@"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏笔时发送快捷键:%@\n松开时发送快捷键:%@"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏筆時發送快速鍵:%@\n鬆開時發送快速鍵:%@"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏筆時發送快速鍵:%@\n鬆開時發送快速鍵:%@"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Start" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
|
||||
@@ -270,6 +270,9 @@
|
||||
@property (weak, nonatomic) IBOutlet UIStackView *doubleTapShortcutStack;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *doubleTapShortcutSwitch;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIStackView *squeezeShortcutStack;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *squeezeShortcutSwitch;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIStackView *pencilPausesNativeTouchStack;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *pencilPausesNativeTouchSwitch;
|
||||
|
||||
|
||||
@@ -392,6 +392,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
|
||||
[self.pressureCurveSwitch setOn:oscProfile.pressureCurveEnabled];
|
||||
[self.doubleTapShortcutSwitch setOn:oscProfile.doubleTapShorcutEnabled];
|
||||
[self.squeezeShortcutSwitch setOn:oscProfile.squeezeShorcutEnabled];
|
||||
[self.pencilPausesNativeTouchSwitch setOn:oscProfile.pencilPausesNativeTouch];
|
||||
[self.disablePencilSlideGestureSwitch setOn:oscProfile.disablePencilSlideGestures];
|
||||
}
|
||||
@@ -416,6 +417,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
&& (int16_t)(oscProfile.physicalRightStickMinOffset) == (int16_t)self.rightStickMinOffsetSlider.value
|
||||
&& oscProfile.pressureCurveEnabled == self.pressureCurveSwitch.isOn
|
||||
&& oscProfile.doubleTapShorcutEnabled == self.doubleTapShortcutSwitch.isOn
|
||||
&& oscProfile.squeezeShorcutEnabled == self.squeezeShortcutSwitch.isOn
|
||||
&& oscProfile.pencilPausesNativeTouch == self.pencilPausesNativeTouchSwitch.isOn
|
||||
&& oscProfile.disablePencilSlideGestures == self.disablePencilSlideGestureSwitch.isOn
|
||||
);
|
||||
@@ -436,6 +438,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
oscProfile.physicalRightStickMinOffset = (int16_t)self.rightStickMinOffsetSlider.value;
|
||||
oscProfile.pressureCurveEnabled = self.pressureCurveSwitch.isOn;
|
||||
oscProfile.doubleTapShorcutEnabled = self.doubleTapShortcutSwitch.isOn;
|
||||
oscProfile.squeezeShorcutEnabled = self.squeezeShortcutSwitch.isOn;
|
||||
oscProfile.pencilPausesNativeTouch = self.pencilPausesNativeTouchSwitch.isOn;
|
||||
oscProfile.disablePencilSlideGestures = self.disablePencilSlideGestureSwitch.isOn;
|
||||
[oscProfileMan replaceSelectedProfileWith:oscProfile overwriteDefault:YES];
|
||||
@@ -878,6 +881,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self addSetting:self.pencilTickIntervalStack ofId:@"pencilTickIntervalStack" withInfoTag:NO withDynamicLabel:YES 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.squeezeShortcutStack ofId:@"squeezeShortcutStack" withInfoTag:YES 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];
|
||||
[pencilSection addToParentStack:_parentStack];
|
||||
@@ -1498,6 +1502,14 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
];
|
||||
showOnlineDocAction = false;
|
||||
}
|
||||
if([sender.superview.accessibilityIdentifier isEqualToString: @"squeezeShortcutStack"]){
|
||||
oscProfile = [oscProfileMan getSelectedProfile];
|
||||
tipText = [LocalizationHelper localizedStringForKey:@"squeezeShortcutStackTip"
|
||||
, [oscProfile.squeezeStartShortcut isEqualToString:@""] ? [LocalizationHelper localizedStringForKey:@"Null"] : oscProfile.squeezeStartShortcut
|
||||
, [oscProfile.squeezeEndShortcut isEqualToString:@""] ? [LocalizationHelper localizedStringForKey:@"Null"] : oscProfile.squeezeEndShortcut
|
||||
];
|
||||
showOnlineDocAction = false;
|
||||
}
|
||||
|
||||
UIAlertController *tipsAlertController = [UIAlertController alertControllerWithTitle: [LocalizationHelper localizedStringForKey:@"Tips"] message:tipText preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
@@ -3395,6 +3407,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
[self pencilTickModeChanged:self.pencilTickSelector];
|
||||
[self.pressureCurveSwitch setOn:false];
|
||||
[self.doubleTapShortcutSwitch setOn:false];
|
||||
[self.squeezeShortcutSwitch setOn:false];
|
||||
[self.pencilPausesNativeTouchSwitch setOn:false];
|
||||
[self.disablePencilSlideGestureSwitch setOn:false];
|
||||
|
||||
@@ -3441,6 +3454,17 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
}
|
||||
}
|
||||
|
||||
- (void)squeezeShortcutSwitchFlipped:(UISwitch* )sender{
|
||||
if(sender.isOn && !settingsViewJustLoaded){
|
||||
[IAPManager checkPurchaseInfo:AddOnProductPencilProPack completion:^(PurchaseInfo* info) {
|
||||
if(info.valid) [PencilHandler enterSqueezeShortcutsIn:self];
|
||||
else {
|
||||
[IAPManager inAppPurchaseActionWithViewController:self product:AddOnProductPencilProPack];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)disablePencilSlideGestureSwitchFlipped:(UISwitch* )sender{
|
||||
if(sender.isOn && !settingsViewJustLoaded){
|
||||
[IAPManager checkPurchaseInfo:AddOnProductPencilProPack completion:^(PurchaseInfo* info) {
|
||||
@@ -3472,6 +3496,11 @@ BOOL isCustomResolution(int resolutionSelected) {
|
||||
|
||||
[self.pressureCurveSwitch addTarget:self action:@selector(pressureCurveSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
[self.doubleTapShortcutSwitch addTarget:self action:@selector(doubleTapShortcutSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
|
||||
[self.squeezeShortcutSwitch addTarget:self action:@selector(squeezeShortcutSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
if (@available(iOS 17.5, *)) nil;
|
||||
else [self.squeezeShortcutSwitch setEnabled:false];
|
||||
|
||||
[self.disablePencilSlideGestureSwitch addTarget:self action:@selector(disablePencilSlideGestureSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
[self.pencilPausesNativeTouchSwitch addTarget:self action:@selector(pencilPausesNativeTouchSwitchFlipped:) forControlEvents:UIControlEventValueChanged];
|
||||
}
|
||||
|
||||
@@ -1338,7 +1338,7 @@
|
||||
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC));
|
||||
dispatch_after(delay, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
NSArray* hdrCommand = [CommandManager.shared extractAutoReleaseButtonStringsFrom:@"WIN+ALT+B"];
|
||||
[CommandManager.shared sendAutoReleaseComboCommandWithCmdString:hdrCommand delay:0.15 index:0];
|
||||
[CommandManager.shared sendAutoReleaseComboCommandWithCmdString:hdrCommand delay:0.15 index:0 pressOnly:false releaseOnly:false];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1747,6 +1747,36 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ccv-UD-RYW.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Squeeze Shortcut\"; ObjectID = \"ccv-UD-RYW\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Squeeze Shortcut"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "捏笔快捷键"
|
||||
}
|
||||
},
|
||||
"zh-Hant" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "捏筆快速鍵"
|
||||
}
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "捏筆快速鍵"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Ce3-FM-vIh.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Frames to Buffer\"; ObjectID = \"Ce3-FM-vIh\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
@@ -5378,18 +5408,18 @@
|
||||
}
|
||||
},
|
||||
"v5f-j3-pEc.text" : {
|
||||
"comment" : "Class = \"UILabel\"; text = \"Double Tap Shorcut\"; ObjectID = \"v5f-j3-pEc\";",
|
||||
"comment" : "Class = \"UILabel\"; text = \"Double Tap Shortcut\"; ObjectID = \"v5f-j3-pEc\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Double Tap Shorcut"
|
||||
"value" : "Double Tap Shortcut"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"state" : "needs_review",
|
||||
"value" : "轻点两下快捷键"
|
||||
}
|
||||
},
|
||||
@@ -5401,7 +5431,7 @@
|
||||
},
|
||||
"zh-HK" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"state" : "needs_review",
|
||||
"value" : "輕點兩下快速鍵"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user