Repo // Apply shouldAlwaysUseShiftKeyAccommodation

This commit is contained in:
ShikiSuen 2022-09-01 22:26:38 +08:00
parent aa39fe3017
commit 6c2a51651f
1 changed files with 9 additions and 3 deletions

View File

@ -17,9 +17,15 @@ extension ctlInputMethod {
/// - Returns: `true` IMK`false` /// - Returns: `true` IMK`false`
func commonEventHandler(_ event: NSEvent) -> Bool { func commonEventHandler(_ event: NSEvent) -> Bool {
// Shift macOS 10.15 macOS // Shift macOS 10.15 macOS
let shouldUseHandle = let shouldUseHandle: Bool = {
(IME.arrClientShiftHandlingExceptionList.contains(clientBundleIdentifier) switch mgrPrefs.shiftKeyAccommodationBehavior {
|| mgrPrefs.shouldAlwaysUseShiftKeyAccommodation) case 0: return false
case 1: return IME.arrClientShiftHandlingExceptionList.contains(clientBundleIdentifier)
case 2: return true
default: return false
}
}()
if #available(macOS 10.15, *) { if #available(macOS 10.15, *) {
if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode { if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode {
if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) { if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) {