From 131d442bbc002c692d0048b5c9e30bae1f5b609f Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Wed, 23 Feb 2022 14:05:31 +0800 Subject: [PATCH] KeyHandler // Use (Shift+)Tab Key to handle candidates. --- Source/Modules/ControllerModules/KeyHandler.mm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/Modules/ControllerModules/KeyHandler.mm b/Source/Modules/ControllerModules/KeyHandler.mm index c0e55c38..e81d5b5d 100644 --- a/Source/Modules/ControllerModules/KeyHandler.mm +++ b/Source/Modules/ControllerModules/KeyHandler.mm @@ -1024,6 +1024,20 @@ static NSString *const kGraphVizOutputfile = @"/tmp/vChewing-visualization.dot"; return YES; } + if ([input isTab]) { + BOOL updated = + Preferences.specifyTabKeyBehavior? + ([input isShiftHold] ? [gCurrentCandidateController showPreviousPage] : [gCurrentCandidateController showNextPage]) + : + ([input isShiftHold] ? [gCurrentCandidateController highlightPreviousCandidate] : [gCurrentCandidateController highlightNextCandidate]) + ; + if (!updated) { + [self errorCallbackConsolePrint:@"9B691919"]; + errorCallback(); + } + return YES; + } + if ([input isSpace] || [input isPageDown] || input.emacsKey == vChewingEmacsKeyNextPage) { BOOL updated = [gCurrentCandidateController showNextPage]; if (!updated) {