Repo // Tweak alsoConfirmAssociatedCandidatesByEnter().
This commit is contained in:
parent
beed28efe8
commit
5b58442d67
|
@ -102,7 +102,7 @@ extension InputHandler {
|
||||||
if let keyCodeType = KeyCode(rawValue: input.keyCode) {
|
if let keyCodeType = KeyCode(rawValue: input.keyCode) {
|
||||||
switch keyCodeType {
|
switch keyCodeType {
|
||||||
case .kLineFeed, .kCarriageReturn:
|
case .kLineFeed, .kCarriageReturn:
|
||||||
if state.type == .ofAssociates, !prefs.alsoConfirmAssociatedCandidatesByEnter {
|
if state.type == .ofAssociates, !(input.isShiftHold || prefs.alsoConfirmAssociatedCandidatesByEnter) {
|
||||||
delegate.switchState(IMEState.ofAbortion())
|
delegate.switchState(IMEState.ofAbortion())
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class PrefMgr: PrefMgrProtocol {
|
||||||
@AppProperty(key: UserDef.kAutoCorrectReadingCombination.rawValue, defaultValue: true)
|
@AppProperty(key: UserDef.kAutoCorrectReadingCombination.rawValue, defaultValue: true)
|
||||||
public var autoCorrectReadingCombination: Bool
|
public var autoCorrectReadingCombination: Bool
|
||||||
|
|
||||||
@AppProperty(key: UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue, defaultValue: true)
|
@AppProperty(key: UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue, defaultValue: false)
|
||||||
public var alsoConfirmAssociatedCandidatesByEnter: Bool
|
public var alsoConfirmAssociatedCandidatesByEnter: Bool
|
||||||
|
|
||||||
@AppProperty(key: UserDef.kKeepReadingUponCompositionError.rawValue, defaultValue: false)
|
@AppProperty(key: UserDef.kKeepReadingUponCompositionError.rawValue, defaultValue: false)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
// marks, or product names of Contributor, except as required to fulfill notice
|
// marks, or product names of Contributor, except as required to fulfill notice
|
||||||
// requirements defined in MIT License.
|
// requirements defined in MIT License.
|
||||||
|
|
||||||
|
import AppKit
|
||||||
import Foundation
|
import Foundation
|
||||||
import Shared
|
import Shared
|
||||||
import Tekkon
|
import Tekkon
|
||||||
|
@ -99,7 +100,8 @@ public extension SessionCtl {
|
||||||
let candidateString: String = candidateString?.string ?? ""
|
let candidateString: String = candidateString?.string ?? ""
|
||||||
if state.type == .ofAssociates {
|
if state.type == .ofAssociates {
|
||||||
// 聯想詞的 Shift+選字鍵的處理已經在其它位置實作完成。
|
// 聯想詞的 Shift+選字鍵的處理已經在其它位置實作完成。
|
||||||
if !PrefMgr.shared.alsoConfirmAssociatedCandidatesByEnter {
|
let isShiftHold = NSEvent.modifierFlags.contains(.shift)
|
||||||
|
if !(isShiftHold || PrefMgr.shared.alsoConfirmAssociatedCandidatesByEnter) {
|
||||||
switchState(IMEState.ofAbortion())
|
switchState(IMEState.ofAbortion())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ struct VwrPrefPaneBehavior: View {
|
||||||
@Backport.AppStorage(wrappedValue: true, UserDef.kUseSpaceToCommitHighlightedSCPCCandidate.rawValue)
|
@Backport.AppStorage(wrappedValue: true, UserDef.kUseSpaceToCommitHighlightedSCPCCandidate.rawValue)
|
||||||
private var useSpaceToCommitHighlightedSCPCCandidate: Bool
|
private var useSpaceToCommitHighlightedSCPCCandidate: Bool
|
||||||
|
|
||||||
@Backport.AppStorage(wrappedValue: true, UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue)
|
@Backport.AppStorage(wrappedValue: false, UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue)
|
||||||
private var alsoConfirmAssociatedCandidatesByEnter: Bool
|
private var alsoConfirmAssociatedCandidatesByEnter: Bool
|
||||||
|
|
||||||
@Backport.AppStorage(wrappedValue: true, UserDef.kTogglingAlphanumericalModeWithLShift.rawValue)
|
@Backport.AppStorage(wrappedValue: true, UserDef.kTogglingAlphanumericalModeWithLShift.rawValue)
|
||||||
|
|
Loading…
Reference in New Issue