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