1
\$\begingroup\$

Unity for Android suggests that you can hide the TouchScreenKeyboard's input field with the command TouchScreenKeyboard.hideInput. Superficially this looks like it works, but it has numerous problems detailed here and here

Unity says they are just hiding the input field, and it should no longer be interactive while hidden. But this doesn't work. Primarily, underlining from autocorrect suggestions still shows up. Even worse, clicking anywhere in the area of the hidden input field causes a cascade of errors that crashes the keyboard and closes it.

To illustrate, here was a simple demo project I made showing the input field we are trying to get rid of:

enter image description here

Here is what it looks like with the input field hidden by Unity:

enter image description here

There are two problems with the hiding. First, the blue horizontal line is an underline of an autocorrect suggestion which should not be visible. Second, clicking anywhere in the red box area (red box was added to image for illustration) crashes the keyboard with errors.

I submitted a bug report to Unity but as this has been ongoing at least 3 years from what I see on the forum and I need it fixed, I would like to try looking into it as well.

I have seen and used codes to measure the Android keyboard height and manipulate the colors and visibility of the Android status bars and navigation bars. However, I have not been able to find any examples of code that accesses or manipulates this TouchScreenKeyboard input field.

ie. If you run TouchScreenKeyboard keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default); what would be some Android code you can run in Unity that would manipulate the resulting input field attached to the opened keyboard?

Perhaps the best solution would be to simply move it several thousand pixels off screen so it is harmless. Otherwise it must be set to ignore clicks made in its region and the autocorrect lines need hiding.

Any ideas for what Android code controls this input field or how it could be manipulated from Unity? Thanks.

\$\endgroup\$
1
  • \$\begingroup\$ Does this issue persist when the "Hide Mobile Input" box is checked in the inspector? I havent yet seen this issue and my assumption would be that if unity is bad at hiding an active menu, perhaps it is better at not loading it at all \$\endgroup\$ Oct 28, 2022 at 15:18

0

You must log in to answer this question.

Browse other questions tagged .