ctlIME // Note: alphanumerical mode toggle only works >= macOS 10.15.

This commit is contained in:
ShikiSuen 2022-08-10 11:12:44 +08:00
parent b6f8939928
commit a3eae2a77f
1 changed files with 12 additions and 10 deletions

View File

@ -187,20 +187,22 @@ class ctlInputMethod: IMKInputController {
@objc(handleEvent:client:) override func handle(_ event: NSEvent!, client sender: Any!) -> Bool {
_ = sender //
// Shift
if ShiftKeyUpChecker.check(event) {
if !rencentKeyHandledByKeyHandler {
NotifierController.notify(
message: String(
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
toggleASCIIMode()
// Shift macOS 10.15 macOS
if #available(macOS 10.15, *) {
if ShiftKeyUpChecker.check(event) {
if !rencentKeyHandledByKeyHandler {
NotifierController.notify(
message: String(
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
toggleASCIIMode()
? NSLocalizedString("NotificationSwitchON", comment: "")
: NSLocalizedString("NotificationSwitchOFF", comment: "")
)
)
)
}
rencentKeyHandledByKeyHandler = false
return false
}
rencentKeyHandledByKeyHandler = false
return false
}
/// flags使 KeyHandler