Repo // Fix selection key errors of vertical IMKCandidates.
This commit is contained in:
parent
ec35ebf24b
commit
4676c995ce
|
@ -19,6 +19,7 @@ import Tekkon
|
|||
|
||||
/// KeyHandler 委任協定
|
||||
public protocol KeyHandlerDelegate {
|
||||
var selectionKeys: String { get }
|
||||
var clientBundleIdentifier: String { get }
|
||||
func candidateController() -> CtlCandidateProtocol
|
||||
func candidateSelectionCalledByKeyHandler(at index: Int)
|
||||
|
|
|
@ -232,8 +232,10 @@ extension KeyHandler {
|
|||
let match: String =
|
||||
(state.type == .ofAssociates) ? input.inputTextIgnoringModifiers ?? "" : input.text
|
||||
|
||||
for j in 0..<PrefMgr.shared.candidateKeys.count {
|
||||
let label = PrefMgr.shared.candidateKeys.charComponents[j]
|
||||
let selectionKeys = delegate?.selectionKeys ?? PrefMgr.shared.candidateKeys
|
||||
|
||||
for j in 0..<selectionKeys.count {
|
||||
let label = selectionKeys.charComponents[j]
|
||||
if match.compare(label, options: .caseInsensitive, range: nil, locale: .current) == .orderedSame {
|
||||
index = j
|
||||
break
|
||||
|
|
|
@ -53,7 +53,9 @@ extension SessionCtl: KeyHandlerDelegate {
|
|||
// MARK: - Candidate Controller Delegate
|
||||
|
||||
extension SessionCtl: CtlCandidateDelegate {
|
||||
var selectionKeys: String { PrefMgr.shared.candidateKeys }
|
||||
var selectionKeys: String {
|
||||
PrefMgr.shared.useIMKCandidateWindow ? "123456789" : PrefMgr.shared.candidateKeys
|
||||
}
|
||||
|
||||
func buzz() {
|
||||
IMEApp.buzz()
|
||||
|
|
Loading…
Reference in New Issue