KeyHandler // Documentation fix.

This commit is contained in:
ShikiSuen 2022-06-29 10:25:38 +08:00
parent 4bdb528f2d
commit dbe54d7a8b
4 changed files with 21 additions and 10 deletions

View File

@ -66,7 +66,7 @@ class KeyHandler {
willSet {
//
let isCHS: Bool = (newValue == InputMode.imeModeCHS)
/// ctlInputMethod IME
/// Prefs IME
IME.currentInputMode = newValue
mgrPrefs.mostRecentInputMode = IME.currentInputMode.rawValue
///
@ -176,8 +176,8 @@ class KeyHandler {
)
//
if !mgrPrefs.useSCPCTypingMode {
//
var addToUserOverrideModel = true
//
if selectedNode.spanningLength != value.count {
IME.prtDebugIntel("UOM: SpanningLength != value.count, dismissing.")
addToUserOverrideModel = false

View File

@ -31,6 +31,13 @@ import Cocoa
// MARK: - § 調 (Handle Candidate State).
extension KeyHandler {
///
/// - Parameters:
/// - input:
/// - state:
/// - stateCallback:
/// - errorCallback:
/// - Returns: IMK
func handleCandidate(
state: InputStateProtocol,
input: InputSignal,
@ -352,7 +359,7 @@ extension KeyHandler {
]
let customPunctuation: String = arrCustomPunctuations.joined(separator: "")
///
///
let arrPunctuations: [String] = [punctuationNamePrefix, String(format: "%c", CChar(charCode))]
let punctuation: String = arrPunctuations.joined(separator: "")

View File

@ -32,6 +32,13 @@ import Cocoa
// MARK: - § 調 (Handle Input with States)
extension KeyHandler {
///
/// - Parameters:
/// - input:
/// - state:
/// - stateCallback:
/// - errorCallback:
/// - Returns: IMK
func handle(
input: InputSignal,
state: InputStateProtocol,
@ -78,7 +85,7 @@ extension KeyHandler {
{
// BackSpace
} else if input.isCapsLockOn {
//
//
clear()
stateCallback(InputState.Empty())
@ -256,9 +263,7 @@ extension KeyHandler {
return true
}
// MARK: Calling candidate window using Up / Down or PageUp / PageDn.
//
// MARK: (Calling candidate window using Up / Down or PageUp / PageDn.)
if let currentState = state as? InputState.NotEmpty, composer.isEmpty,
input.isExtraChooseCandidateKey || input.isExtraChooseCandidateKeyReverse || input.isSpace
@ -394,7 +399,7 @@ extension KeyHandler {
inputting.textToCommit = textToCommit
stateCallback(inputting)
stateCallback(buildCandidate(state: inputting, isTypingVertical: input.isTypingVertical))
} else { // If there is still unfinished bpmf reading, ignore the punctuation
} else { //
IME.prtDebugIntel("17446655")
errorCallback()
}

View File

@ -113,9 +113,8 @@ extension KeyHandler {
let composedText = head + reading + tail
let cursorIndex = composedStringCursorIndex + reading.utf16.count
var cleanedComposition = ""
//
var cleanedComposition = ""
for theChar in composedText {
if let charCode = theChar.utf16.first {
if !(theChar.isASCII && !(charCode.isPrintable())) {