1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02:00

Android: open input dialog on double tap with physical keyboard (#16269)

This commit is contained in:
siliconsniffer
2025-08-02 10:06:29 +02:00
committed by GitHub
parent 0c12c1f400
commit 60cd83a332

View File

@@ -246,8 +246,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
#ifdef __ANDROID__ #ifdef __ANDROID__
// display software keyboard when clicking edit boxes // display software keyboard when clicking edit boxes
if (event.EventType == EET_MOUSE_INPUT_EVENT && if (event.EventType == EET_MOUSE_INPUT_EVENT &&
event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN && ((event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN &&
!porting::hasPhysicalKeyboardAndroid()) { !porting::hasPhysicalKeyboardAndroid()) ||
event.MouseInput.Event == EMIE_LMOUSE_DOUBLE_CLICK)) {
gui::IGUIElement *hovered = gui::IGUIElement *hovered =
Environment->getRootGUIElement()->getElementFromPoint( Environment->getRootGUIElement()->getElementFromPoint(
core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y)); core::position2d<s32>(event.MouseInput.X, event.MouseInput.Y));
@@ -276,7 +277,9 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event)
porting::showTextInputDialog("", porting::showTextInputDialog("",
wide_to_utf8(((gui::IGUIEditBox *) hovered)->getText()), type); 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;
} }
} }