Press a key to enter in a text field

Is there anyway to press a key and make it so I can start typing into a text field instead of having to click in the text field?

You can use GUI.FocusControl.

#pragma strict

var CheatCode : String;
private var CheatField : String = "";

function OnGUI () 
{
	GUI.SetNextControlName("MyTextField");
	CheatField = GUI.TextField(Rect(10,580,200,20), CheatField, 25);
	if(CheatField != "" && Event.current.keyCode == KeyCode.Return)
	{
		CheatCode = CheatField;
		CheatField = "";
		print(CheatCode);
	}
	GUI.FocusControl("MyTextField");
}