Lagrange [work/v1.9]

Allow using Tab key for bindings

=> b1e5138a5c0a846c63f684ea15eeb8280430b55e

diff --git a/src/app.c b/src/app.c
index dcb35c3d..133d55a6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1022,6 +1022,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));
diff --git a/src/ui/widget.c b/src/ui/widget.c
index cef36a00..67ec87cd 100644
--- a/src/ui/widget.c
+++ b/src/ui/widget.c
@@ -906,16 +906,7 @@ static iBool scrollOverflow_Widget_(iWidget *d, int delta) {
 }
 
 iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) {
-    if (ev->type == SDL_KEYDOWN) {
-        if (ev->key.keysym.sym == SDLK_TAB) {
-            setFocus_Widget(findFocusable_Widget(focus_Widget(),
-                                                 ev->key.keysym.mod & KMOD_SHIFT
-                                                     ? backward_WidgetFocusDir
-                                                     : forward_WidgetFocusDir));
-            return iTrue;
-        }
-    }
-    else if (d->flags & commandOnClick_WidgetFlag &&
+    if (d->flags & commandOnClick_WidgetFlag &&
              (ev->type == SDL_MOUSEBUTTONDOWN || ev->type == SDL_MOUSEBUTTONUP) &&
              (mouseGrab_Widget() == d || contains_Widget(d, init_I2(ev->button.x, ev->button.y)))) {
         postCommand_Widget(d,
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.9/cdiff/b1e5138a5c0a846c63f684ea15eeb8280430b55e
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
28.103275 milliseconds
Gemini-to-HTML Time
0.148657 milliseconds

This content has been proxied by September (ba2dc).