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.
This commit is contained in:
ShikiSuen 2022-03-23 19:20:46 +08:00
parent 7ab71c79e3
commit 8cef08d142
1 changed files with 2 additions and 1 deletions

View File

@ -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]]) {