From 4c8270c42f9fa42a75266adac7496e391b9ecc35 Mon Sep 17 00:00:00 2001 From: Lukhnos Liu Date: Sat, 17 Oct 2020 06:19:47 -0700 Subject: [PATCH] Cancel candidate by Bksp or Del when Plain Bopomofo Fixes #152 --- Source/InputMethodController.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/InputMethodController.mm b/Source/InputMethodController.mm index 0af52c86..aafe55c0 100644 --- a/Source/InputMethodController.mm +++ b/Source/InputMethodController.mm @@ -989,7 +989,12 @@ public: } } - if (charCode == 27) { + BOOL cancelCandidateKey = + (charCode == 27) || + ((_inputMode == kPlainBopomofoModeIdentifier) && + (charCode == 8 || keyCode == kDeleteKeyCode)); + + if (cancelCandidateKey) { gCurrentCandidateController.visible = NO; [_candidates removeAllObjects];