From 12167aeafbb733b71dd416b40f421f4435f494d2 Mon Sep 17 00:00:00 2001 From: Benau Date: Fri, 17 Jul 2020 19:12:00 +0800 Subject: [PATCH] Fix missing general text field dialog enter callback in android --- src/guiengine/widgets/CGUIEditBox.hpp | 2 +- src/guiengine/widgets/text_box_widget.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/guiengine/widgets/CGUIEditBox.hpp b/src/guiengine/widgets/CGUIEditBox.hpp index f25fc9c67..a0c3644d1 100644 --- a/src/guiengine/widgets/CGUIEditBox.hpp +++ b/src/guiengine/widgets/CGUIEditBox.hpp @@ -140,6 +140,7 @@ namespace GUIEngine virtual void setComposingText(const std::u32string& ct) { m_composing_text = ct; } virtual void clearComposingText() { m_composing_text.clear(); } virtual const core::position2di& getICPos() const { return m_ic_pos; } + void sendGuiEvent(EGUI_EVENT_TYPE type); protected: //! sets the area of the given line void setTextRect(s32 line); @@ -148,7 +149,6 @@ namespace GUIEngine //! calculates the current scroll position void calculateScrollPos(); //! send some gui event to parent - void sendGuiEvent(EGUI_EVENT_TYPE type); //! set text markers void setTextMarkers(s32 begin, s32 end); void updateCursorDistance(); diff --git a/src/guiengine/widgets/text_box_widget.cpp b/src/guiengine/widgets/text_box_widget.cpp index 7b2911cb2..96a6b40c6 100644 --- a/src/guiengine/widgets/text_box_widget.cpp +++ b/src/guiengine/widgets/text_box_widget.cpp @@ -372,6 +372,11 @@ ANDROID_HANDLE_ACTION_NEXT_CALLBACK(ANDROID_PACKAGE_CALLBACK_NAME) } return; } + else + { + // Required for some general text field dialog + eb->sendGuiEvent(EGET_EDITBOX_ENTER); + } // As it's action "next", check if below widget is a text box, if // so focus it and keep the screen keyboard, so user can keep