diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-10 14:27:20 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-04-10 14:27:20 +0300 |
commit | 44b1f58bb25817d2bc4578e727ce637752d00299 (patch) | |
tree | 9e5be8932a15ebafa97cac5888b31087e33ea090 /src/ui | |
parent | 963ad5fad6905a94c077246b8045e139e1139fc8 (diff) |
Allow using Tab key for bindings
Tab was always consumed by focus cycling even though that should be at the lowest priority.
IssueID #244
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/widget.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index 1ef2360c..3eea761e 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -906,16 +906,7 @@ static iBool scrollOverflow_Widget_(iWidget *d, int delta) { | |||
906 | } | 906 | } |
907 | 907 | ||
908 | iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) { | 908 | iBool processEvent_Widget(iWidget *d, const SDL_Event *ev) { |
909 | if (ev->type == SDL_KEYDOWN) { | 909 | if (d->flags & commandOnClick_WidgetFlag && |
910 | if (ev->key.keysym.sym == SDLK_TAB) { | ||
911 | setFocus_Widget(findFocusable_Widget(focus_Widget(), | ||
912 | ev->key.keysym.mod & KMOD_SHIFT | ||
913 | ? backward_WidgetFocusDir | ||
914 | : forward_WidgetFocusDir)); | ||
915 | return iTrue; | ||
916 | } | ||
917 | } | ||
918 | else if (d->flags & commandOnClick_WidgetFlag && | ||
919 | (ev->type == SDL_MOUSEBUTTONDOWN || ev->type == SDL_MOUSEBUTTONUP) && | 910 | (ev->type == SDL_MOUSEBUTTONDOWN || ev->type == SDL_MOUSEBUTTONUP) && |
920 | (mouseGrab_Widget() == d || contains_Widget(d, init_I2(ev->button.x, ev->button.y)))) { | 911 | (mouseGrab_Widget() == d || contains_Widget(d, init_I2(ev->button.x, ev->button.y)))) { |
921 | postCommand_Widget(d, | 912 | postCommand_Widget(d, |