ctlIME // Sync recent changes to handleDelegateEvent().
This commit is contained in:
parent
4a716bbde3
commit
ab8840aac6
|
@ -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 {
|
|||
)
|
||||
)
|
||||
}
|
||||
rencentKeyHandledByKeyHandler = false
|
||||
if shouldUseHandle {
|
||||
rencentKeyHandledByKeyHandler = false
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +108,9 @@ extension ctlInputMethod: ctlCandidateDelegate {
|
|||
} errorCallback: {
|
||||
clsSFX.beep()
|
||||
}
|
||||
rencentKeyHandledByKeyHandler = result
|
||||
if shouldUseHandle {
|
||||
rencentKeyHandledByKeyHandler = result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue