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