From 70f10f2084ce4c1e59652bb47e27c1f1c928dda5 Mon Sep 17 00:00:00 2001 From: siliconsniffer <97843108+siliconsniffer@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:32:35 +0200 Subject: [PATCH] Android: open input dialog on double tap with physical keyboard. Co-authored-by: grorp --- src/gui/modalMenu.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index d5c717d51..680837b56 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -246,8 +246,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event) #ifdef __ANDROID__ // display software keyboard when clicking edit boxes if (event.EventType == EET_MOUSE_INPUT_EVENT && - event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN && - !porting::hasPhysicalKeyboardAndroid()) { + ((event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN && + !porting::hasPhysicalKeyboardAndroid()) || + event.MouseInput.Event == EMIE_LMOUSE_DOUBLE_CLICK)) { gui::IGUIElement *hovered = Environment->getRootGUIElement()->getElementFromPoint( core::position2d(event.MouseInput.X, event.MouseInput.Y)); @@ -276,7 +277,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event) porting::showTextInputDialog("", wide_to_utf8(((gui::IGUIEditBox *) hovered)->getText()), type); - return retval; + // Since we have opened the dialog, we have to return true to mark + // the event as handled (avoids double-opening). + return true; } }