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