TextField focus

“NEWBIE WARNING”

I am implementing a simple multiplayer game and I tried to add the “typical-one-line-chat” funtionality:

  1. player hits TAB -> text field appears to the bottom
  2. player enters text and hits RETURN -> text field disappears
    At the same time player can still look around with mouse.

I tried to do this by attaching Lemur TextField to GuiNode when player presses the TAB. The problem is that don’t know how to automatically give it focus. Now it requires player to select the TextField with mouse pointer, which is a problem as mouse pointer is disabled.

All tips on how to solve this are welcome!

2 Likes

…Sorry! After four hours of futile attempts to solve this - I found the GuiGlobals.requestFocus() immediately after writing this help request.
:facepalm:

2 Likes

I started implementing automatic focus navigation sometime back but haven’t finished it. Glad you found a work-around.