diff --git a/Source/Modules/InputHandler_HandleCandidate.swift b/Source/Modules/InputHandler_HandleCandidate.swift index b4bd09ba..2f38584a 100644 --- a/Source/Modules/InputHandler_HandleCandidate.swift +++ b/Source/Modules/InputHandler_HandleCandidate.swift @@ -102,7 +102,7 @@ extension InputHandler { if let keyCodeType = KeyCode(rawValue: input.keyCode) { switch keyCodeType { case .kLineFeed, .kCarriageReturn: - if state.type == .ofAssociates, !prefs.alsoConfirmAssociatedCandidatesByEnter { + if state.type == .ofAssociates, !(input.isShiftHold || prefs.alsoConfirmAssociatedCandidatesByEnter) { delegate.switchState(IMEState.ofAbortion()) return true } diff --git a/Source/Modules/PrefMgr_Core.swift b/Source/Modules/PrefMgr_Core.swift index 4bcc2a4a..1dde454f 100644 --- a/Source/Modules/PrefMgr_Core.swift +++ b/Source/Modules/PrefMgr_Core.swift @@ -114,7 +114,7 @@ public class PrefMgr: PrefMgrProtocol { @AppProperty(key: UserDef.kAutoCorrectReadingCombination.rawValue, defaultValue: true) public var autoCorrectReadingCombination: Bool - @AppProperty(key: UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue, defaultValue: true) + @AppProperty(key: UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue, defaultValue: false) public var alsoConfirmAssociatedCandidatesByEnter: Bool @AppProperty(key: UserDef.kKeepReadingUponCompositionError.rawValue, defaultValue: false) diff --git a/Source/Modules/SessionCtl_IMKCandidatesData.swift b/Source/Modules/SessionCtl_IMKCandidatesData.swift index 9a464494..2a3fc48e 100644 --- a/Source/Modules/SessionCtl_IMKCandidatesData.swift +++ b/Source/Modules/SessionCtl_IMKCandidatesData.swift @@ -6,6 +6,7 @@ // marks, or product names of Contributor, except as required to fulfill notice // requirements defined in MIT License. +import AppKit import Foundation import Shared import Tekkon @@ -99,7 +100,8 @@ public extension SessionCtl { let candidateString: String = candidateString?.string ?? "" if state.type == .ofAssociates { // 聯想詞的 Shift+選字鍵的處理已經在其它位置實作完成。 - if !PrefMgr.shared.alsoConfirmAssociatedCandidatesByEnter { + let isShiftHold = NSEvent.modifierFlags.contains(.shift) + if !(isShiftHold || PrefMgr.shared.alsoConfirmAssociatedCandidatesByEnter) { switchState(IMEState.ofAbortion()) return } diff --git a/Source/Modules/UIModules/PrefUI/VwrPrefPaneBehavior.swift b/Source/Modules/UIModules/PrefUI/VwrPrefPaneBehavior.swift index 9b0942fc..93d9fca2 100644 --- a/Source/Modules/UIModules/PrefUI/VwrPrefPaneBehavior.swift +++ b/Source/Modules/UIModules/PrefUI/VwrPrefPaneBehavior.swift @@ -40,7 +40,7 @@ struct VwrPrefPaneBehavior: View { @Backport.AppStorage(wrappedValue: true, UserDef.kUseSpaceToCommitHighlightedSCPCCandidate.rawValue) private var useSpaceToCommitHighlightedSCPCCandidate: Bool - @Backport.AppStorage(wrappedValue: true, UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue) + @Backport.AppStorage(wrappedValue: false, UserDef.kAlsoConfirmAssociatedCandidatesByEnter.rawValue) private var alsoConfirmAssociatedCandidatesByEnter: Bool @Backport.AppStorage(wrappedValue: true, UserDef.kTogglingAlphanumericalModeWithLShift.rawValue)