From 8cef08d142e2cea8bade6ddb5c0c0ea82a35ec5b Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 23 Mar 2022 19:20:46 +0800 Subject: [PATCH] KeyHandler // Pass Shift+FWD/BKW in Candidate window. - Sometimes, a user may want to immediately mark phrases even if the IME is in the ChoosingCandidate state, and the IME farts / beeps. Now, these two hotkey combination cancel the current Candidate window, so the user doesn't need to press ESC / Delete / BackSpace. --- Source/Modules/ControllerModules/KeyHandler.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Modules/ControllerModules/KeyHandler.mm b/Source/Modules/ControllerModules/KeyHandler.mm index e74ed04c..c18031f8 100644 --- a/Source/Modules/ControllerModules/KeyHandler.mm +++ b/Source/Modules/ControllerModules/KeyHandler.mm @@ -1002,7 +1002,8 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot"; UniChar charCode = input.charCode; VTCandidateController *gCurrentCandidateController = [self.delegate candidateControllerForKeyHandler:self]; - BOOL cancelCandidateKey = [input isBackSpace] || [input isESC] || [input isDelete]; + BOOL cancelCandidateKey = [input isBackSpace] || [input isESC] || [input isDelete] + || (([input isCursorBackward] || [input isCursorForward]) && [input isShiftHold]); if (cancelCandidateKey) { if ([state isKindOfClass: [InputStateAssociatedPhrases class]]) {