diff --git a/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift b/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift
index e6fd4f1a..d4c4c737 100644
--- a/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift
+++ b/Packages/vChewing_Shared/Sources/Shared/Protocols/PrefMgrProtocol.swift
@@ -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 }
diff --git a/Packages/vChewing_Shared/Sources/Shared/Shared.swift b/Packages/vChewing_Shared/Sources/Shared/Shared.swift
index 2d9138dd..7ff0876b 100644
--- a/Packages/vChewing_Shared/Sources/Shared/Shared.swift
+++ b/Packages/vChewing_Shared/Sources/Shared/Shared.swift
@@ -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"
diff --git a/Source/Modules/InputHandler_HandleComposition.swift b/Source/Modules/InputHandler_HandleComposition.swift
index 9a9e6782..527027cb 100644
--- a/Source/Modules/InputHandler_HandleComposition.swift
+++ b/Source/Modules/InputHandler_HandleComposition.swift
@@ -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 內的筆畫來做檢查了。
// 來看看詞庫內到底有沒有對應的讀音索引。這裡用了類似「|=」的判斷處理方式。
diff --git a/Source/Modules/PrefMgr_Core.swift b/Source/Modules/PrefMgr_Core.swift
index 16b4bfb1..22a1829a 100644
--- a/Source/Modules/PrefMgr_Core.swift
+++ b/Source/Modules/PrefMgr_Core.swift
@@ -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)
diff --git a/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift b/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift
index 42406f83..94f59d8b 100644
--- a/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift
+++ b/Source/Modules/UIModules/PrefUI/VwrPrefPaneCassette.swift
@@ -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 {
diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings
index 54c11116..1f1aeea1 100644
--- a/Source/Resources/Base.lproj/Localizable.strings
+++ b/Source/Resources/Base.lproj/Localizable.strings
@@ -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";
diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings
index 54c11116..1f1aeea1 100644
--- a/Source/Resources/en.lproj/Localizable.strings
+++ b/Source/Resources/en.lproj/Localizable.strings
@@ -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";
diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings
index bf1a556f..302dc2e2 100644
--- a/Source/Resources/ja.lproj/Localizable.strings
+++ b/Source/Resources/ja.lproj/Localizable.strings
@@ -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" = "入力中で打ち間違った発音組み合わせを自動的に訂正する";
diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings
index ec98e630..4520f505 100644
--- a/Source/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Source/Resources/zh-Hans.lproj/Localizable.strings
@@ -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" = "敲字时自动纠正读音组合";
diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings
index 6ca88027..94cd1ec0 100644
--- a/Source/Resources/zh-Hant.lproj/Localizable.strings
+++ b/Source/Resources/zh-Hant.lproj/Localizable.strings
@@ -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" = "敲字時自動糾正讀音組合";
diff --git a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
index c8faa936..7c55286b 100644
--- a/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
+++ b/Source/WindowNIBs/Base.lproj/frmPrefWindow.xib
@@ -1058,11 +1058,11 @@
-
+
-
+
@@ -1073,7 +1073,7 @@
-
+
-
+
-
+
-
+
@@ -1163,6 +1163,19 @@
+
@@ -1280,7 +1295,7 @@
-
+
diff --git a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
index c6b115e8..d0404feb 100644
--- a/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/en.lproj/frmPrefWindow.strings
@@ -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";
diff --git a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
index 82de57d9..80472bfc 100644
--- a/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/ja.lproj/frmPrefWindow.strings
@@ -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" = "イェール弁音 (ローマ字+数字音調)";
diff --git a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
index 01ff8d5c..41728fb6 100644
--- a/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/zh-Hans.lproj/frmPrefWindow.strings
@@ -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" = "耶鲁拼音+数字标调";
diff --git a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
index efc9bc15..2ae1bf56 100644
--- a/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
+++ b/Source/WindowNIBs/zh-Hant.lproj/frmPrefWindow.strings
@@ -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" = "耶魯拼音+數字標調";