how to type in a gui textfield without having to select it with mouse?

Here’s my script.

#pragma strict
var stringToEdit : String = "";

var style : GUIStyle;

function OnGUI()
	stringToEdit = GUI.TextField (Rect (Screen.width/2 -50, Screen.height/2, 200, 40), stringToEdit, 25, style);

the variable stringtoEdit is a string. I could do if (Input.GetKey(“a”)){stringToEdit += a}. I dont want to do the whole alphabet like that. There has to be a faster way and since I haven’t messed with Gui enough to learn the ins and outs I can’t think of a better solution. I get the feeling I’m missing something obvious but I can’t figure it out so I need your help. I read the manual but didn’t find what I was looking for.

Try this

I haven’t used it but it seems to fit your needs.