ctlIME // Chromium compatibility with Alphanumerical mode toggle.

- Finally patched this ****.
This commit is contained in:
ShikiSuen 2022-08-08 10:44:50 +08:00
parent d09b2e6d0d
commit 5aa1729bd1
1 changed files with 15 additions and 7 deletions

View File

@ -46,6 +46,9 @@ class ctlInputMethod: IMKInputController {
return isASCIIMode return isASCIIMode
} }
/// `handle(event:)` Shift
private var rencentKeyHandledByKeyHandler = false
// MARK: - // MARK: -
/// ///
@ -188,13 +191,17 @@ class ctlInputMethod: IMKInputController {
// Shift // Shift
if ShiftKeyUpChecker.check(event) { if ShiftKeyUpChecker.check(event) {
if !rencentKeyHandledByKeyHandler {
NotifierController.notify( NotifierController.notify(
message: String( message: String(
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n", format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
toggleASCIIMode() toggleASCIIMode()
? NSLocalizedString("NotificationSwitchON", comment: "") ? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "") : NSLocalizedString("NotificationSwitchOFF", comment: "")
)) )
)
}
rencentKeyHandledByKeyHandler = false
return false return false
} }
@ -240,6 +247,7 @@ class ctlInputMethod: IMKInputController {
} errorCallback: { } errorCallback: {
clsSFX.beep() clsSFX.beep()
} }
rencentKeyHandledByKeyHandler = result
return result return result
} }