From 44b1f58bb25817d2bc4578e727ce637752d00299 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 10 Apr 2021 14:27:20 +0300 Subject: Allow using Tab key for bindings Tab was always consumed by focus cycling even though that should be at the lowest priority. IssueID #244 --- src/app.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 2ccadca8..d8053315 100644 --- a/src/app.c +++ b/src/app.c @@ -1023,6 +1023,16 @@ void processEvents_App(enum iAppEventMode eventMode) { /* There may be a key bindings for this. */ wasUsed = processEvent_Keys(&ev); } + if (!wasUsed) { + /* Focus cycling. */ + if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_TAB) { + setFocus_Widget(findFocusable_Widget(focus_Widget(), + ev.key.keysym.mod & KMOD_SHIFT + ? backward_WidgetFocusDir + : forward_WidgetFocusDir)); + wasUsed = iTrue; + } + } if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) { #if defined (iPlatformAppleDesktop) handleCommand_MacOS(command_UserEvent(&ev)); -- cgit v1.2.3