ctlIME // Chromium compatibility with Alphanumerical mode toggle.
- Finally patched this ****.
This commit is contained in:
parent
d09b2e6d0d
commit
5aa1729bd1
|
@ -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) {
|
||||||
NotifierController.notify(
|
if !rencentKeyHandledByKeyHandler {
|
||||||
message: String(
|
NotifierController.notify(
|
||||||
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
|
message: String(
|
||||||
toggleASCIIMode()
|
format: "%@%@%@", NSLocalizedString("Alphanumerical Mode", comment: ""), "\n",
|
||||||
? NSLocalizedString("NotificationSwitchON", comment: "")
|
toggleASCIIMode()
|
||||||
: NSLocalizedString("NotificationSwitchOFF", comment: "")
|
? NSLocalizedString("NotificationSwitchON", 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue