ctlIME // Use another keylayout if Shift-Alphanumerical mode is ON.

This commit is contained in:
ShikiSuen 2022-09-12 17:39:30 +08:00
parent 5a16d6d638
commit ece124d05d
1 changed files with 6 additions and 3 deletions

View File

@ -42,7 +42,7 @@ class ctlInputMethod: IMKInputController {
/// ctlInputMethod /// ctlInputMethod
static var isVerticalCandidateSituation: Bool = false static var isVerticalCandidateSituation: Bool = false
/// ctlInputMethod /// ctlInputMethod
var isASCIIMode: Bool = false var isASCIIMode: Bool = false { didSet { setKeyLayout() } }
/// 調 /// 調
var keyHandler: KeyHandler = .init() var keyHandler: KeyHandler = .init()
/// ///
@ -66,9 +66,12 @@ class ctlInputMethod: IMKInputController {
/// ///
func setKeyLayout() { func setKeyLayout() {
if let client = client() { guard let client = client() else { return }
client.overrideKeyboard(withKeyboardNamed: mgrPrefs.basicKeyboardLayout) if isASCIIMode, AppleKeyboardConverter.isDynamicBasicKeyboardLayoutEnabled {
client.overrideKeyboard(withKeyboardNamed: mgrPrefs.alphanumericalKeyboardLayout)
return
} }
client.overrideKeyboard(withKeyboardNamed: mgrPrefs.basicKeyboardLayout)
} }
/// 調 /// 調