SessionCtl // Attempt to do annotations with IMKCandidates.

This commit is contained in:
ShikiSuen 2022-10-24 11:04:09 +08:00
parent 5fbc2fb728
commit 11d2ce635d
1 changed files with 11 additions and 14 deletions

View File

@ -7,6 +7,7 @@
// requirements defined in MIT License.
import Foundation
import Shared
import Tekkon
// MARK: - IMKCandidates
@ -53,20 +54,16 @@ extension SessionCtl {
}
/// IMK
/// - Parameter _:
public override func candidateSelectionChanged(_: NSAttributedString!) {
//
// IMKServer.commitCompositionWithReply() commitComposition()
// inputHandler
//
//
// ctlCandidateIMK identifier
// NSNotFound NSLog identifier
// console ips
// candidateSelected() identifier NSNotFound
// IMK 西
/// - Parameter currentSelection:
public override func candidateSelectionChanged(_ currentSelection: NSAttributedString!) {
guard let currentCandidate = currentSelection?.string, !currentCandidate.isEmpty else { return }
let annotation = reverseLookup(for: currentCandidate).joined(separator: "\n")
guard !annotation.isEmpty else { return }
vCLog("Current Annotation: \(annotation)")
DispatchQueue.main.async {
guard let imkCandidates = self.ctlCandidateCurrent as? CtlCandidateIMK else { return }
imkCandidates.showAnnotation(.init(string: annotation))
}
}
/// IMK