Send KEY_END when (re)creating a text input
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 13 Aug 2011 16:56:15 +0000 (18:56 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 22 Aug 2011 11:02:08 +0000 (13:02 +0200)
This ensures that on creation and when resizing the cursor is at the end
of the text rather than at the beginnig.

src/guiTextInputMenu.cpp

index bfe0ea5de259b0123a0d20f80a864f7049d92b5e..208ced803cd21ee6e750f7755c339c545817610a 100644 (file)
@@ -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("");
        {