Reset // Properly set CHS and CHT mode switches.
This commit is contained in:
parent
0f52f8d736
commit
3e9f50e567
|
@ -9,6 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
typedef NSString *const InputMode NS_TYPED_ENUM;
|
||||
extern InputMode imeModeCHT;
|
||||
extern InputMode imeModeCHS;
|
||||
extern InputMode imeModeNULL;
|
||||
|
||||
@class KeyHandler;
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ using namespace vChewing;
|
|||
|
||||
InputMode imeModeCHT = @"org.atelierInmu.inputmethod.vChewing.IMECHT";
|
||||
InputMode imeModeCHS = @"org.atelierInmu.inputmethod.vChewing.IMECHS";
|
||||
InputMode imeModeNULL = @"org.atelierInmu.inputmethod.vChewing.IMENULL";
|
||||
|
||||
static const double kEpsilon = 0.000001;
|
||||
|
||||
|
|
|
@ -101,7 +101,15 @@ class ctlInputMethod: IMKInputController {
|
|||
}
|
||||
|
||||
override func setValue(_ value: Any!, forTag tag: Int, client: Any!) {
|
||||
let newInputMode = InputMode(rawValue: value as? String ?? InputMode.imeModeCHT.rawValue)
|
||||
var newInputMode = InputMode(rawValue: value as? String ?? InputMode.imeModeNULL.rawValue)
|
||||
switch newInputMode {
|
||||
case InputMode.imeModeCHS:
|
||||
newInputMode = InputMode.imeModeCHS
|
||||
case InputMode.imeModeCHT:
|
||||
newInputMode = InputMode.imeModeCHT
|
||||
default:
|
||||
newInputMode = InputMode.imeModeNULL
|
||||
}
|
||||
mgrLangModel.loadDataModel(newInputMode)
|
||||
if keyHandler.inputMode != newInputMode {
|
||||
UserDefaults.standard.synchronize()
|
||||
|
|
Loading…
Reference in New Issue