In the docs it says:
Using this code:
iif (GUI.Button(new Rect(60, 120, 200, 42), "Close the Keyboard"))
{
if(keyboard != null)
keyboard.active = false;
}
This will not work as the keyboard text field has focus (FirstResponder) so clicking the button to make the keyboard go away will not work. I guess you have to resign the text field as the FirstResponder (which I thought active = false; was doing).
Is there a way to manage closing the keyboard without using the Done button ?
thx
Could you explain your use case in a greater detail?
I’m not sure why you are trying to use GUI button to close keyboard.
Thanks for the reply.
At present the only way to close the keyboard is by using the Done button (all types of keyboard). Although in some cases you can hit the return key which is really more of an issue than a feature because of the lack of multiline input for Textfields (see other thread).
Let’s say the user wanted to just click away from the keyboard to:
- close it
- not save the input that was in the keyboard textfield
at present I don’t see how that is possible. It is valid with the iPhone to click/touch away to close the keyboard. The button could be anything but I chose a button so that you could have a background transparent button to effect the event (close the keyboard). Although a hit test would be more efficient. You get the idea.