- Home /
How can I force a TextArea to get focus?
Let's say I wanted that for each time the "\" button is pressed, a GUILayout.TextArea becomes focused (like, it responds to keys) so you can type in it without having to click on it. How could I do so?
Comment
Best Answer
Answer by macweirdo · Dec 29, 2011 at 11:57 PM
Found it, I just use
GUI.SetNextControlName("ChatBox");
before I define the control and use
GUI.FocusControl("ChatBox");
to focus it.