From 8213962272cadd50a9cf717e875daab93a2f29d0 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 25 Mar 2022 22:43:27 +0800 Subject: [PATCH] ctlIME // +setKeyLayout(). --- Source/Modules/IMEModules/ctlInputMethod.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Modules/IMEModules/ctlInputMethod.swift b/Source/Modules/IMEModules/ctlInputMethod.swift index a93c8ed1..abc0f9a6 100644 --- a/Source/Modules/IMEModules/ctlInputMethod.swift +++ b/Source/Modules/IMEModules/ctlInputMethod.swift @@ -61,6 +61,13 @@ class ctlInputMethod: IMKInputController { static var currentKeyHandler: KeyHandler = KeyHandler() @objc static var currentInputMode = "" + // MARK: - Keyboard Layout Specifier + + @objc func setKeyLayout(isfunctionKeyboardLayout: Bool = false) { + let client = client().self as IMKTextInput + client.overrideKeyboard(withKeyboardNamed: isfunctionKeyboardLayout ? mgrPrefs.functionKeyboardLayout : mgrPrefs.basisKeyboardLayout) + } + // MARK: - IMKInputController methods override init!(server: IMKServer!, delegate: Any!, client inputClient: Any!) {