From: Giuseppe Bilotta Date: Sat, 13 Aug 2011 16:56:15 +0000 (+0200) Subject: Send KEY_END when (re)creating a text input X-Git-Tag: 0.2.20110922~39^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=42134bb49eaa5116838a2c188c432c8b9420dff8;p=oweals%2Fminetest.git Send KEY_END when (re)creating a text input This ensures that on creation and when resizing the cursor is at the end of the text rather than at the beginnig. --- diff --git a/src/guiTextInputMenu.cpp b/src/guiTextInputMenu.cpp index bfe0ea5de..208ced803 100644 --- a/src/guiTextInputMenu.cpp +++ b/src/guiTextInputMenu.cpp @@ -103,6 +103,12 @@ void GUITextInputMenu::regenerateGui(v2u32 screensize) gui::IGUIElement *e = Environment->addEditBox(text.c_str(), rect, true, this, 256); Environment->setFocus(e); + + irr::SEvent evt; + evt.EventType = EET_KEY_INPUT_EVENT; + evt.KeyInput.Key = KEY_END; + evt.KeyInput.PressedDown = true; + e->OnEvent(evt); } changeCtype(""); {