LMCassette // Add support for `%keys_to_directly_commit`.
This commit is contained in:
parent
2a4b01c234
commit
51580ac2fb
|
@ -19,6 +19,8 @@ public extension vChewingLM.LMInstantiator {
|
|||
var nullCandidateInCassette: String { Self.lmCassette.nullCandidate }
|
||||
/// 磁帶模式專用:選字鍵是否需要敲 Shift 才會生效。
|
||||
var areCassetteCandidateKeysShiftHeld: Bool { Self.lmCassette.areCandidateKeysShiftHeld }
|
||||
/// 磁帶模式專用:需要直接递交的按键。
|
||||
var keysToDirectlyCommit: String { Self.lmCassette.keysToDirectlyCommit }
|
||||
/// 磁帶模式專用:選字鍵,在威注音輸入法當中僅優先用於快速模式。
|
||||
var cassetteSelectionKey: String? {
|
||||
let result = Self.lmCassette.selectionKeys
|
||||
|
|
|
@ -26,6 +26,7 @@ public extension vChewingLM {
|
|||
public private(set) var selectionKeys: String = ""
|
||||
public private(set) var endKeys: [String] = []
|
||||
public private(set) var wildcardKey: String = ""
|
||||
public private(set) var keysToDirectlyCommit: String = ""
|
||||
public private(set) var keyNameMap: [String: String] = [:]
|
||||
public private(set) var quickDefMap: [String: String] = [:]
|
||||
public private(set) var charDefMap: [String: [String]] = [:]
|
||||
|
@ -208,6 +209,9 @@ public extension vChewingLM {
|
|||
if wildcardKey.isEmpty, strLine.starts(with: "%wildcardkey ") {
|
||||
wildcardKey = cells[1].first?.description ?? ""
|
||||
}
|
||||
if keysToDirectlyCommit.isEmpty, strLine.starts(with: "%keys_to_directly_commit ") {
|
||||
keysToDirectlyCommit = strSecondCell
|
||||
}
|
||||
}
|
||||
// Post process.
|
||||
if CandidateKey.validate(keys: selectionKeys) != nil { selectionKeys = "1234567890" }
|
||||
|
|
Loading…
Reference in New Issue