SessionCtl // Turn off Caps Lock if Eisu key is turned off.
This commit is contained in:
parent
6c371b844f
commit
6be6492470
|
@ -11,6 +11,7 @@ import IMKUtils
|
|||
import InputMethodKit
|
||||
import NotifierUI
|
||||
import Shared
|
||||
import SwiftyCapsLockToggler
|
||||
|
||||
// MARK: - Facade
|
||||
|
||||
|
@ -183,10 +184,15 @@ public extension SessionCtl {
|
|||
/// 切換英數模式開關。
|
||||
private func toggleAlphanumericalMode() {
|
||||
let status = "NotificationSwitchRevolver".localized
|
||||
let oldValue = isASCIIMode
|
||||
let newValue = isASCIIMode.toggled()
|
||||
Notifier.notify(
|
||||
message: isASCIIMode.toggled()
|
||||
message: newValue
|
||||
? NSLocalizedString("Alphanumerical Input Mode", comment: "") + "\n" + status
|
||||
: NSLocalizedString("Chinese Input Mode", comment: "") + "\n" + status
|
||||
)
|
||||
if oldValue, !newValue, Self.isCapsLocked {
|
||||
CapsLockToggler.turnOff()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue