summaryrefslogtreecommitdiff
path: root/src/guiTextInputMenu.cpp
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-13 18:56:15 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-08-22 13:02:08 +0200
commit42134bb49eaa5116838a2c188c432c8b9420dff8 (patch)
tree1e49d43ce5d3cfa29c8e81411199c377b8ac9972 /src/guiTextInputMenu.cpp
parent0488bf54d3f0b767eb53a026b4b52de86cfbd4ab (diff)
downloadminetest-42134bb49eaa5116838a2c188c432c8b9420dff8.tar.gz
minetest-42134bb49eaa5116838a2c188c432c8b9420dff8.tar.bz2
minetest-42134bb49eaa5116838a2c188c432c8b9420dff8.zip
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.
Diffstat (limited to 'src/guiTextInputMenu.cpp')
-rw-r--r--src/guiTextInputMenu.cpp6
1 files changed, 6 insertions, 0 deletions
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("");
{