ctlIME // Note: alphanumerical mode toggle only works >= macOS 10.15.
This commit is contained in:
parent
e3f5d1ec93
commit
c02e52e9d2
|
@ -187,20 +187,22 @@ class ctlInputMethod: IMKInputController {
|
||||||
@objc(handleEvent:client:) override func handle(_ event: NSEvent!, client sender: Any!) -> Bool {
|
@objc(handleEvent:client:) override func handle(_ event: NSEvent!, client sender: Any!) -> Bool {
|
||||||
_ = sender // 防止格式整理工具毀掉與此對應的參數。
|
_ = sender // 防止格式整理工具毀掉與此對應的參數。
|
||||||
|
|
||||||
// 用 Shift 開關半形英數模式。
|
// 用 Shift 開關半形英數模式,僅對 macOS 10.15 及之後的 macOS 有效。
|
||||||
if ShiftKeyUpChecker.check(event) {
|
if #available(macOS 10.15, *) {
|
||||||
if !rencentKeyHandledByKeyHandler {
|
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",
|
||||||
|
toggleASCIIMode()
|
||||||
? NSLocalizedString("NotificationSwitchON", comment: "")
|
? NSLocalizedString("NotificationSwitchON", comment: "")
|
||||||
: NSLocalizedString("NotificationSwitchOFF", comment: "")
|
: NSLocalizedString("NotificationSwitchOFF", comment: "")
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
|
rencentKeyHandledByKeyHandler = false
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
rencentKeyHandledByKeyHandler = false
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 這裡仍舊需要判斷 flags。之前使輸入法狀態卡住無法敲漢字的問題已在 KeyHandler 內修復。
|
/// 這裡仍舊需要判斷 flags。之前使輸入法狀態卡住無法敲漢字的問題已在 KeyHandler 內修復。
|
||||||
|
|
Loading…
Reference in New Issue