Prefs // Add "AutoCombineLongestPossibleCassetteKey".
This commit is contained in:
parent
177100ba2c
commit
d9258192f5
|
@ -52,6 +52,7 @@ public protocol PrefMgrProtocol {
|
|||
var showTranslatedStrokesInCompositionBuffer: Bool { get set }
|
||||
var forceCassetteChineseConversion: Int { get set }
|
||||
var showReverseLookupInCandidateUI: Bool { get set }
|
||||
var autoCompositeWithLongestPossibleCassetteKey: Bool { get set }
|
||||
var cns11643Enabled: Bool { get set }
|
||||
var cassetteEnabled: Bool { get set }
|
||||
var symbolInputEnabled: Bool { get set }
|
||||
|
|
|
@ -65,6 +65,7 @@ public enum UserDef: String, CaseIterable {
|
|||
case kShowTranslatedStrokesInCompositionBuffer = "ShowTranslatedStrokesInCompositionBuffer"
|
||||
case kForceCassetteChineseConversion = "ForceCassetteChineseConversion"
|
||||
case kShowReverseLookupInCandidateUI = "ShowReverseLookupInCandidateUI"
|
||||
case kAutoCompositeWithLongestPossibleCassetteKey = "AutoCompositeWithLongestPossibleCassetteKey"
|
||||
|
||||
case kUseIMKCandidateWindow = "UseIMKCandidateWindow"
|
||||
case kHandleDefaultCandidateFontsByLangIdentifier = "HandleDefaultCandidateFontsByLangIdentifier"
|
||||
|
|
|
@ -183,7 +183,7 @@ extension InputHandler {
|
|||
|| input.isControlHold || input.isOptionHold || input.isShiftHold || input.isCommandHold
|
||||
|
||||
var isLongestPossibleKeyFormed: Bool {
|
||||
guard !isWildcardKeyInput else { return false }
|
||||
guard !isWildcardKeyInput, prefs.autoCompositeWithLongestPossibleCassetteKey else { return false }
|
||||
return !currentLM.currentCassette.hasUnigramsFor(key: calligrapher + wildcard) && !calligrapher.isEmpty
|
||||
}
|
||||
|
||||
|
@ -217,7 +217,9 @@ extension InputHandler {
|
|||
}
|
||||
}
|
||||
|
||||
var combineStrokes = isStrokesFull || (isWildcardKeyInput && !calligrapher.isEmpty)
|
||||
var combineStrokes =
|
||||
(isStrokesFull && prefs.autoCompositeWithLongestPossibleCassetteKey)
|
||||
|| (isWildcardKeyInput && !calligrapher.isEmpty)
|
||||
|
||||
// 如果當前的按鍵是 Enter 或 Space 的話,這時就可以取出 calligrapher 內的筆畫來做檢查了。
|
||||
// 來看看詞庫內到底有沒有對應的讀音索引。這裡用了類似「|=」的判斷處理方式。
|
||||
|
|
|
@ -149,6 +149,9 @@ public class PrefMgr: PrefMgrProtocol {
|
|||
@AppProperty(key: UserDef.kShowReverseLookupInCandidateUI.rawValue, defaultValue: true)
|
||||
public var showReverseLookupInCandidateUI: Bool
|
||||
|
||||
@AppProperty(key: UserDef.kAutoCompositeWithLongestPossibleCassetteKey.rawValue, defaultValue: true)
|
||||
public var autoCompositeWithLongestPossibleCassetteKey: Bool
|
||||
|
||||
// MARK: - Settings (Tier 2)
|
||||
|
||||
@AppProperty(key: UserDef.kUseIMKCandidateWindow.rawValue, defaultValue: false)
|
||||
|
|
|
@ -23,6 +23,8 @@ struct VwrPrefPaneCassette: View {
|
|||
forKey: UserDef.kForceCassetteChineseConversion.rawValue)
|
||||
@State private var selShowTranslatedStrokesInCompositionBuffer: Bool = UserDefaults.standard.bool(
|
||||
forKey: UserDef.kShowTranslatedStrokesInCompositionBuffer.rawValue)
|
||||
@State private var selAutoCompositeWithLongestPossibleCassetteKey = UserDefaults.standard.bool(
|
||||
forKey: UserDef.kAutoCompositeWithLongestPossibleCassetteKey.rawValue)
|
||||
|
||||
private static let dlgOpenFile = NSOpenPanel()
|
||||
|
||||
|
@ -132,6 +134,13 @@ struct VwrPrefPaneCassette: View {
|
|||
// MARK: - Something Else
|
||||
|
||||
SSPreferences.Section(title: "") {
|
||||
Toggle(
|
||||
LocalizedStringKey("Auto-composite when the longest possible key is formed"),
|
||||
isOn: $selAutoCompositeWithLongestPossibleCassetteKey.onChange {
|
||||
PrefMgr.shared.autoCompositeWithLongestPossibleCassetteKey =
|
||||
selAutoCompositeWithLongestPossibleCassetteKey
|
||||
}
|
||||
)
|
||||
Toggle(
|
||||
LocalizedStringKey("Show translated strokes in composition buffer"),
|
||||
isOn: $selShowTranslatedStrokesInCompositionBuffer.onChange {
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
"Apple Chewing - Eten Traditional" = "Apple Chewing - Eten Traditional";
|
||||
"Applying typing suggestions from half-life user override model" = "Applying typing suggestions from half-life user override model";
|
||||
"at the rear of the phrase (like Microsoft New Phonetic)" = "at the rear of the phrase (like Microsoft New Phonetic)";
|
||||
"Auto-composite when the longest possible key is formed" = "Auto-composite when the longest possible key is formed";
|
||||
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "Auto-convert traditional Chinese glyphs to JIS Shinjitai characters";
|
||||
"Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters";
|
||||
"Automatically correct reading combinations when typing" = "Automatically correct reading combinations when typing";
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
"Apple Chewing - Eten Traditional" = "Apple Chewing - Eten Traditional";
|
||||
"Applying typing suggestions from half-life user override model" = "Applying typing suggestions from half-life user override model";
|
||||
"at the rear of the phrase (like Microsoft New Phonetic)" = "at the rear of the phrase (like Microsoft New Phonetic)";
|
||||
"Auto-composite when the longest possible key is formed" = "Auto-composite when the longest possible key is formed";
|
||||
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "Auto-convert traditional Chinese glyphs to JIS Shinjitai characters";
|
||||
"Auto-convert traditional Chinese glyphs to KangXi characters" = "Auto-convert traditional Chinese glyphs to KangXi characters";
|
||||
"Automatically correct reading combinations when typing" = "Automatically correct reading combinations when typing";
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
"Apple Chewing - Eten Traditional" = "Apple 倚天傳統キーボード";
|
||||
"Applying typing suggestions from half-life user override model" = "入力中で臨時記憶モジュールからお薦めの候補を自動的に選ぶ";
|
||||
"at the rear of the phrase (like Microsoft New Phonetic)" = "単語の後で // Microsoft 新注音入力のやり方";
|
||||
"Auto-composite when the longest possible key is formed" = "最長可能キーができた場合、文字を組み立つ";
|
||||
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "入力した繁体字を日文 JIS 新字体と自動変換";
|
||||
"Auto-convert traditional Chinese glyphs to KangXi characters" = "入力した繁体字を康熙字体と自動変換";
|
||||
"Automatically correct reading combinations when typing" = "入力中で打ち間違った発音組み合わせを自動的に訂正する";
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
"Apple Chewing - Eten Traditional" = "Apple 倚天传统键盘排列";
|
||||
"Applying typing suggestions from half-life user override model" = "在敲字时自动套用来自半衰记忆模组的建议";
|
||||
"at the rear of the phrase (like Microsoft New Phonetic)" = "将游标置于词语后方 // Windows 微软新注音风格";
|
||||
"Auto-composite when the longest possible key is formed" = "在已经敲出最长可能码的时候自动组字";
|
||||
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "自动将繁体中文字转为日文 JIS 新字体";
|
||||
"Auto-convert traditional Chinese glyphs to KangXi characters" = "自动将繁体中文字转为康熙正体字";
|
||||
"Automatically correct reading combinations when typing" = "敲字时自动纠正读音组合";
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
"Apple Chewing - Eten Traditional" = "Apple 倚天傳統鍵盤佈局";
|
||||
"Applying typing suggestions from half-life user override model" = "在敲字時自動套用來自半衰記憶模組的建議";
|
||||
"at the rear of the phrase (like Microsoft New Phonetic)" = "將游標置於詞語後方 // Windows 微軟新注音風格";
|
||||
"Auto-composite when the longest possible key is formed" = "在已經敲出最長可能碼的時候自動組字";
|
||||
"Auto-convert traditional Chinese glyphs to JIS Shinjitai characters" = "自動將繁體中文字轉為日文 JIS 新字體";
|
||||
"Auto-convert traditional Chinese glyphs to KangXi characters" = "自動將繁體中文字轉為康熙正體字";
|
||||
"Automatically correct reading combinations when typing" = "敲字時自動糾正讀音組合";
|
||||
|
|
|
@ -1058,11 +1058,11 @@
|
|||
<point key="canvasLocation" x="-400.5" y="-349.5"/>
|
||||
</visualEffectView>
|
||||
<visualEffectView blendingMode="behindWindow" material="sidebar" state="followsWindowActiveState" id="ZEr-3U-K9a" userLabel="vwrCassette">
|
||||
<rect key="frame" x="0.0" y="0.0" width="445" height="481"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="445" height="488"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField autoresizesSubviews="NO" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="vgR-3O-aTP">
|
||||
<rect key="frame" x="18" y="445" width="409" height="16"/>
|
||||
<rect key="frame" x="18" y="452" width="409" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="0d5-PL-rme"/>
|
||||
</constraints>
|
||||
|
@ -1073,7 +1073,7 @@
|
|||
</textFieldCell>
|
||||
</textField>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="ZcE-jK-2vl">
|
||||
<rect key="frame" x="20" y="413" width="405" height="20"/>
|
||||
<rect key="frame" x="20" y="420" width="405" height="20"/>
|
||||
<subviews>
|
||||
<button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8LP-EF-YwT" userLabel="btnOpenFolderToSpecifyForUserData">
|
||||
<rect key="frame" x="346" y="-1" width="30" height="21"/>
|
||||
|
@ -1132,13 +1132,13 @@
|
|||
</constraints>
|
||||
</customView>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="11" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sgB-kZ-rJg">
|
||||
<rect key="frame" x="20" y="41" width="405" height="355"/>
|
||||
<rect key="frame" x="20" y="26" width="405" height="377"/>
|
||||
<subviews>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="6" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6T7-2y-9JA">
|
||||
<rect key="frame" x="0.0" y="165" width="405" height="190"/>
|
||||
<rect key="frame" x="0.0" y="165" width="405" height="212"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="y75-fJ-x9L">
|
||||
<rect key="frame" x="-1" y="173.5" width="311" height="17"/>
|
||||
<rect key="frame" x="-1" y="195.5" width="311" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="Q0q-bq-qs4"/>
|
||||
</constraints>
|
||||
|
@ -1152,7 +1152,7 @@
|
|||
</connections>
|
||||
</button>
|
||||
<textField wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XN3-ki-c3E" userLabel="lblCassetteModeDescription">
|
||||
<rect key="frame" x="-2" y="70" width="409" height="98"/>
|
||||
<rect key="frame" x="-2" y="92" width="409" height="98"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="405" id="PvQ-jY-ScE"/>
|
||||
</constraints>
|
||||
|
@ -1163,6 +1163,19 @@
|
|||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="T4J-vm-GL6">
|
||||
<rect key="frame" x="-1" y="69.5" width="343" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="Xqh-Qs-b73"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="check" title="Auto-composite when the longest possible key is formed" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="neb-Pz-n1h">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="cellTitle"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="32" name="value" keyPath="values.AutoCombineLongestPossibleCassetteKey" id="VUF-y7-K67"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3eW-vq-tFr">
|
||||
<rect key="frame" x="-1" y="47.5" width="281" height="17"/>
|
||||
<constraints>
|
||||
|
@ -1194,12 +1207,14 @@
|
|||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yaq-5S-KLW">
|
||||
|
@ -1280,7 +1295,7 @@
|
|||
<constraint firstItem="ZcE-jK-2vl" firstAttribute="trailing" secondItem="vgR-3O-aTP" secondAttribute="trailing" id="nkS-Us-Mz7"/>
|
||||
<constraint firstAttribute="trailing" secondItem="vgR-3O-aTP" secondAttribute="trailing" constant="20" id="wkh-Jj-wt0"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="101.5" y="-258.5"/>
|
||||
<point key="canvasLocation" x="101.5" y="-255"/>
|
||||
</visualEffectView>
|
||||
<visualEffectView blendingMode="behindWindow" material="sidebar" state="followsWindowActiveState" id="U4q-xw-mc0" userLabel="vwrKeyboard">
|
||||
<rect key="frame" x="0.0" y="0.0" width="445" height="337"/>
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
"lblIntonationKeyBehavior.title" = "Specify what intonation key does when syllable composer is empty.";
|
||||
"lblShiftBkspKeyBehavior.title" = "Choose the attempted behavior of Shift+BackSpace key.";
|
||||
"lblUpperCaseLetterKeyBehavior.title" = "Choose the behavior of Shift+Letter key with letter inputs.";
|
||||
"neb-Pz-n1h.title" = "Auto-composite when the longest possible key is formed";
|
||||
"o3r-NZ-gsU.title" = "Only enforce conversion in Simplified Chinese mode";
|
||||
"Parser11.title" = "Secondary Pinyin with Numeral Intonation";
|
||||
"Parser12.title" = "Yale Pinyin with Numeral Intonation";
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
"lblIntonationKeyBehavior.title" = "音調組立緩衝列が空かされた時の音調キーの行為をご指定ください。";
|
||||
"lblShiftBkspKeyBehavior.title" = "Shift+BackSpace キーの優先行為をご指定ください。";
|
||||
"lblUpperCaseLetterKeyBehavior.title" = "Shift+文字キーの行為をご指定ください。";
|
||||
"neb-Pz-n1h.title" = "最長可能キーができた場合、文字を組み立つ";
|
||||
"o3r-NZ-gsU.title" = "簡体モードだけの場合、カセットモードの漢字出力転換を";
|
||||
"Parser11.title" = "国音二式 (ローマ字+数字音調)";
|
||||
"Parser12.title" = "イェール弁音 (ローマ字+数字音調)";
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
"lblIntonationKeyBehavior.title" = "指定声调键(在注拼槽为「空」状态时)的行为。";
|
||||
"lblShiftBkspKeyBehavior.title" = "指定 Shift+BackSpace 组合键率先尝试的行为。";
|
||||
"lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母键 的行为。";
|
||||
"neb-Pz-n1h.title" = "在已经敲出最长可能码的时候自动组字";
|
||||
"o3r-NZ-gsU.title" = "仅在简体模式转换至简体";
|
||||
"Parser11.title" = "国音二式+数字标调";
|
||||
"Parser12.title" = "耶鲁拼音+数字标调";
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
"lblIntonationKeyBehavior.title" = "指定聲調鍵(在注拼槽為「空」狀態時)的行為。";
|
||||
"lblShiftBkspKeyBehavior.title" = "指定 Shift+BackSpace 組合鍵率先嘗試的行為。";
|
||||
"lblUpperCaseLetterKeyBehavior.title" = "指定 Shift+字母鍵 的行為。";
|
||||
"neb-Pz-n1h.title" = "在已經敲出最長可能碼的時候自動組字";
|
||||
"o3r-NZ-gsU.title" = "僅在簡體模式轉換至簡體";
|
||||
"Parser11.title" = "國音二式+數字標調";
|
||||
"Parser12.title" = "耶魯拼音+數字標調";
|
||||
|
|
Loading…
Reference in New Issue