From e22efd4e9010626fae1b3d0db8f204b23e38e03b Mon Sep 17 00:00:00 2001 From: zonble Date: Thu, 11 Nov 2021 23:02:18 +0800 Subject: [PATCH] Allows auto-commiting the first candidate when users input a punctuation in plan BPMF mode. --- Source/InputMethodController.mm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/InputMethodController.mm b/Source/InputMethodController.mm index f54b033f..2ed398a7 100644 --- a/Source/InputMethodController.mm +++ b/Source/InputMethodController.mm @@ -984,14 +984,14 @@ public: - (BOOL)handleCandidateEventWithInputText:(NSString *)inputText charCode:(UniChar)charCode keyCode:(NSUInteger)keyCode { - if (_inputMode == kPlainBopomofoModeIdentifier) { - if (charCode == '<') { - keyCode = kPageUpKeyCode; - } - else if (charCode == '>') { - keyCode = kPageDownKeyCode; - } - } +// if (_inputMode == kPlainBopomofoModeIdentifier) { +// if (charCode == '<') { +// keyCode = kPageUpKeyCode; +// } +// else if (charCode == '>') { +// keyCode = kPageDownKeyCode; +// } +// } BOOL cancelCandidateKey = (charCode == 27) || @@ -1138,7 +1138,6 @@ public: } if (_inputMode == kPlainBopomofoModeIdentifier) { - // TODO: also commit punctuation. string layout = [self currentLayout]; string customPunctuation = string("_punctuation_") + layout + string(1, (char)charCode); string punctuation = string("_punctuation_") + string(1, (char)charCode);