KeyHandler // Allow Alt+Up/Dn for candidate rotation.

This commit is contained in:
ShikiSuen 2022-07-17 23:15:59 +08:00
parent 85becea690
commit c89a692173
1 changed files with 12 additions and 1 deletions

View File

@ -262,7 +262,7 @@ extension KeyHandler {
// MARK: (Calling candidate window using Up / Down or PageUp / PageDn.)
if let currentState = state as? InputState.NotEmpty, composer.isEmpty,
if let currentState = state as? InputState.NotEmpty, composer.isEmpty, !input.isOptionHold,
input.isExtraChooseCandidateKey || input.isExtraChooseCandidateKeyReverse || input.isSpace
|| input.isPageDown || input.isPageUp || (input.isTab && mgrPrefs.specifyShiftTabKeyBehavior)
|| (input.isTypingVertical && (input.isVerticalTypingOnlyChooseCandidateKey))
@ -354,6 +354,17 @@ extension KeyHandler {
// MARK: AbsorbedArrowKey
if input.isAbsorbedArrowKey || input.isExtraChooseCandidateKey || input.isExtraChooseCandidateKeyReverse {
if input.isOptionHold, state.type == .ofInputting {
if input.isExtraChooseCandidateKey {
return handleInlineCandidateRotation(
state: state, reverseModifier: false, stateCallback: stateCallback, errorCallback: errorCallback
)
} else if input.isExtraChooseCandidateKeyReverse {
return handleInlineCandidateRotation(
state: state, reverseModifier: true, stateCallback: stateCallback, errorCallback: errorCallback
)
}
}
return handleAbsorbedArrowKey(state: state, stateCallback: stateCallback, errorCallback: errorCallback)
}