How to manually dismiss TouchScreenKeyboard in Unity

Title pretty much sums it up, I know I can bring it up with Open(), but I'd like something like .Close() to manually close it myself in certain circumstances.

Upvotes: 3

Views: 7562

Answers (2)

Yan
Yan

Reputation: 7

You can set they keyboard isntance to null.

For instance, if you had

keyboard = TouchScreenKeyboard.Open(...

then you can close it by doing

keyboard = null;

Upvotes: -1

Kay
Kay

Reputation: 13146

According to the Unity docs of TouchScreenKeyboard you just need to have a reference to the previously opened keyboard (return value of Open) and then TouchScreenKeyboard.active = false;

Upvotes: 6

Related Questions