From f3f8d328ef14b3e454b5612dfc4c02c71130f92d Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 29 Mar 2021 12:32:55 +0300 Subject: Fixed: Keyboard shortcuts stop working Menus can't be disabled or otherwise their items can't be triggered any more. Hidden menus are still supposed to receive key events. IssueID #224 --- src/ui/widget.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ui/widget.c') diff --git a/src/ui/widget.c b/src/ui/widget.c index 23891999..e19a9482 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c @@ -661,6 +661,14 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) { iReverseForEach(PtrArray, i, rootData_.onTop) { iWidget *widget = *i.value; if (isVisible_Widget(widget) && dispatchEvent_Widget(widget, ev)) { +#if 0 + if (ev->type == SDL_KEYDOWN) { + printf("[%p] %s:'%s' (on top) ate the key\n", + widget, class_Widget(widget)->name, + cstr_String(id_Widget(widget))); + fflush(stdout); + } +#endif #if 0 if (ev->type == SDL_MOUSEMOTION) { printf("[%p] %s:'%s' (on top) ate the motion\n", @@ -700,6 +708,14 @@ iBool dispatchEvent_Widget(iWidget *d, const SDL_Event *ev) { continue; } if (dispatchEvent_Widget(child, ev)) { +#if 0 + if (ev->type == SDL_KEYDOWN) { + printf("[%p] %s:'%s' ate the key\n", + child, class_Widget(child)->name, + cstr_String(id_Widget(child))); + fflush(stdout); + } +#endif #if 0 if (ev->type == SDL_MOUSEMOTION) { printf("[%p] %s:'%s' (on top) ate the motion\n", -- cgit v1.2.3