ctlIME // Sync recent changes to handleDelegateEvent().

This commit is contained in:
ShikiSuen 2022-08-14 18:24:40 +08:00
parent 4a716bbde3
commit ab8840aac6
1 changed files with 11 additions and 4 deletions

View File

@ -60,9 +60,12 @@ extension ctlInputMethod: ctlCandidateDelegate {
/// - Returns: `true` IMK`false` /// - Returns: `true` IMK`false`
func handleDelegateEvent(_ event: NSEvent!) -> Bool { func handleDelegateEvent(_ event: NSEvent!) -> Bool {
// Shift macOS 10.15 macOS // Shift macOS 10.15 macOS
let shouldUseHandle =
(IME.arrClientShiftHandlingExceptionList.contains(clientBundleIdentifier)
|| mgrPrefs.shouldAlwaysUseShiftKeyAccommodation)
if #available(macOS 10.15, *) { if #available(macOS 10.15, *) {
if ShiftKeyUpChecker.check(event) { if ShiftKeyUpChecker.check(event), !mgrPrefs.disableShiftTogglingAlphanumericalMode {
if !rencentKeyHandledByKeyHandler { if !shouldUseHandle || (!rencentKeyHandledByKeyHandler && shouldUseHandle) {
NotifierController.notify( NotifierController.notify(
message: String( message: String(
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n", format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
@ -72,7 +75,9 @@ extension ctlInputMethod: ctlCandidateDelegate {
) )
) )
} }
rencentKeyHandledByKeyHandler = false if shouldUseHandle {
rencentKeyHandledByKeyHandler = false
}
return false return false
} }
} }
@ -103,7 +108,9 @@ extension ctlInputMethod: ctlCandidateDelegate {
} errorCallback: { } errorCallback: {
clsSFX.beep() clsSFX.beep()
} }
rencentKeyHandledByKeyHandler = result if shouldUseHandle {
rencentKeyHandledByKeyHandler = result
}
return result return result
} }