Repo // Update certain symbol names.
This commit is contained in:
parent
d98e17afaa
commit
309cd03291
|
@ -18,7 +18,7 @@ public extension vChewingLM.LMInstantiator {
|
|||
/// 磁帶模式專用:指定 `%quick` 快速候選結果當中要過濾掉的無效候選字符號。
|
||||
var nullCandidateInCassette: String { Self.lmCassette.nullCandidate }
|
||||
/// 磁帶模式專用:選字鍵是否需要敲 Shift 才會生效。
|
||||
var areCassetteCandidateKeysShiftPressed: Bool { Self.lmCassette.areCandidateKeysShiftPressed }
|
||||
var areCassetteCandidateKeysShiftHeld: Bool { Self.lmCassette.areCandidateKeysShiftHeld }
|
||||
/// 磁帶模式專用:選字鍵,在威注音輸入法當中僅優先用於快速模式。
|
||||
var cassetteSelectionKey: String? {
|
||||
let result = Self.lmCassette.selectionKeys
|
||||
|
|
|
@ -36,7 +36,7 @@ public extension vChewingLM {
|
|||
public private(set) var octagramMap: [String: Int] = [:]
|
||||
/// 音韻輸入法專用八股文:[字詞:(頻次, 讀音)]。
|
||||
public private(set) var octagramDividedMap: [String: (Int, String)] = [:]
|
||||
public private(set) var areCandidateKeysShiftPressed: Bool = false
|
||||
public private(set) var areCandidateKeysShiftHeld: Bool = false
|
||||
|
||||
/// 計算頻率時要用到的東西
|
||||
private static let fscale = 2.7
|
||||
|
@ -194,7 +194,7 @@ public extension vChewingLM {
|
|||
// Post process.
|
||||
if CandidateKey.validate(keys: selectionKeys) != nil { selectionKeys = "1234567890" }
|
||||
if !keysUsedInCharDef.intersection(selectionKeys.map(\.description)).isEmpty {
|
||||
areCandidateKeysShiftPressed = true
|
||||
areCandidateKeysShiftHeld = true
|
||||
}
|
||||
maxKeyLength = theMaxKeyLength
|
||||
keyNameMap[wildcardKey] = keyNameMap[wildcardKey] ?? "?"
|
||||
|
|
|
@ -153,7 +153,7 @@ extension InputHandler {
|
|||
var index: Int?
|
||||
var shaltShiftHold = [.ofAssociates].contains(state.type)
|
||||
if [.ofInputting].contains(state.type) {
|
||||
let cassetteShift = currentLM.areCassetteCandidateKeysShiftPressed
|
||||
let cassetteShift = currentLM.areCassetteCandidateKeysShiftHeld
|
||||
shaltShiftHold = shaltShiftHold || cassetteShift
|
||||
}
|
||||
let matched: String = shaltShiftHold ? input.inputTextIgnoringModifiers ?? "" : input.text
|
||||
|
|
|
@ -24,7 +24,7 @@ extension InputHandler {
|
|||
if prefs.cassetteEnabled {
|
||||
// 準備處理 `%quick` 選字行為。
|
||||
var handleQuickCandidate = true
|
||||
if currentLM.areCassetteCandidateKeysShiftPressed { handleQuickCandidate = input.isShiftHold }
|
||||
if currentLM.areCassetteCandidateKeysShiftHeld { handleQuickCandidate = input.isShiftHold }
|
||||
let hasQuickCandidates: Bool = delegate.state.type == .ofInputting && delegate.state.isCandidateContainer
|
||||
|
||||
// 處理 `%symboldef` 選字行為。
|
||||
|
|
|
@ -106,7 +106,7 @@ public extension SessionCtl {
|
|||
candidateUI?.tooltip =
|
||||
singleLine ? "⇧" : NSLocalizedString("Hold ⇧ to choose associates.", comment: "")
|
||||
} else if state.type == .ofInputting, state.isCandidateContainer {
|
||||
let useShift = LMMgr.currentLM.areCassetteCandidateKeysShiftPressed
|
||||
let useShift = LMMgr.currentLM.areCassetteCandidateKeysShiftHeld
|
||||
let theEmoji = useShift ? "⬆️" : "⚡️"
|
||||
candidateUI?.tooltip =
|
||||
singleLine ? theEmoji : "\(theEmoji) " + NSLocalizedString("Quick Candidates", comment: "")
|
||||
|
|
Loading…
Reference in New Issue