IME // Allow getInputMode to return a reversed mode.

This commit is contained in:
ShikiSuen 2022-04-18 16:48:38 +08:00
parent 842807c7c2
commit 49390b1076
1 changed files with 7 additions and 2 deletions

View File

@ -35,8 +35,13 @@ public class IME: NSObject {
// MARK: - ctlInputMethod
static func getInputMode() -> InputMode {
ctlInputMethod.currentKeyHandler.inputMode
static func getInputMode(isReversed: Bool = false) -> InputMode {
if isReversed {
return (ctlInputMethod.currentKeyHandler.inputMode == InputMode.imeModeCHT)
? InputMode.imeModeCHS : InputMode.imeModeCHT
} else {
return ctlInputMethod.currentKeyHandler.inputMode
}
}
// MARK: - Print debug information to the console.