- Home /
Question by
cagezero · Apr 25, 2013 at 10:41 PM ·
onguiipadfocustouchscreenkeyboardgui.textfield
TouchScreenKeyboard Should Close When GUI.TextField Loses Focus
If anyone can tell me how do do this I will be most appreciative. I am using the following code:
void OnGUI() {
GUI.SetNextControlName(name);
textString = GUI.TextField(myRect, textString, 25);
if(GUI.GetNameOfFocusedControl() == name)
Debug.Log("I have you now");
else
Debug.Log("Negative, it only impacted on the surface.");
}
What do I need to add to get the keyboard to close when the textField loses focus? As it is when the textfield loses focus the keyboard is still visible and edits the previously focused textField when I type.
I am testing this on an iPad (first gen).
Comment
Honestly, this smells like a bug to me. When no editable object has focus the keyboard should disappear, no?
Your answer
