Hi everyone!
I have a GUI with a textbox. I'd like the user to write something, and then to get a confirmation pressing Return (e.g. make something happen)
How could I do it?
I put in global script:
// called when a key is pressed
function on_key_press(eKeyCode keycode)
{
if (keycode == eKeyReturn)
{
// Text box input accept:
if (gGuiText.Visible == true)
{
// Hide GUI
gGuiText.Visible = false;
//..........DoSomethingElse();
}
}
}
I think the text box which is in GUI has the focus, so it prevents the Return key to be processed by the on_key_press function.
Any idea?
Thanks!
manu
TextBox has OnActivate event which is called when player presses return.
thanks!