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`
func commonEventHandler(_ event: NSEvent) -> Bool {
// Shift macOS 10.15 macOS
let shouldUseHandle =
(IME.arrClientShiftHandlingExceptionList.contains(clientBundleIdentifier)
|| mgrPrefs.shouldAlwaysUseShiftKeyAccommodation)
let shouldUseHandle: Bool = {
switch mgrPrefs.shiftKeyAccommodationBehavior {
case 0: return false
case 1: return IME.arrClientShiftHandlingExceptionList.contains(clientBundleIdentifier)
case 2: return true
default: return false
}
}()
if #available(macOS 10.15, *) {
if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode {
if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) {