Repo // Update certain symbol names.

This commit is contained in:
ShikiSuen 2023-06-23 18:08:15 +08:00
parent d98e17afaa
commit 309cd03291
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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] ?? ""

View File

@ -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

View File

@ -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`

View File

@ -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: "")