Feature Request: Control of mobile TouchScreenKeyboard visibility on focus change

I posted on the forums about this previously and it was suggested to me that I submit it as a bug fix/feature request. I submitted a bug report and was redirected to the forums once again so here I am with this feature request:

(On an android device) I would like a way to keep the mobile TouchScreenKeyboard open when focus changes to a different UI element. This would include being able to interact with unity in the visible area while the keyboard remains on screen.

The current implementation forces the mobile TouchScreenKeyboard to close when its focus is lost. This is not ideal and not consistent with keyboard behavior in most other android apps. This prevents me from creating a smooth experience where, for example, the user can input text which is used to show results of a search. When the user tries to select a result, the input is ignored and the keyboard goes away. The user cannot interact with a scroll view or any buttons while the keyboard is on screen. Almost all android chat interfaces allow users to do this, I would love have this functionality in Unity to give the user a predictable and consistent UI experience.

Here’s a google drive link to a sample project showing this problem using Unity 2020.1.0b13. Just run on an android device and tap the inputfield. When you try to interact with the scroll view or button, the input is ignored and the keyboard hides.

Thank you!

7 Likes

up

1 Like

I brought this up to the Android team again as this is pretty much the #1 request / issue on Android related to text.

4 Likes

Thank you for doing so. I am also facing this issue. Without a fix, Unity is literally unable to support a professional chat app or any app that relies on messaging.

This is quite a severe issue affecting many including Unity’s adoption. Please let us know when there is a fix. Until then, we can either create a custom keyboard (which is far from ideal since the majority of users I speak to say they hate custom keyboards and prefer the one that they use daily) or to uncheck the “Hide Mobile Input” option which results in an input system that is so far removed from any professional/respectable app.

Thank you for your time. Quite literally praying this can get fixed asap or else we are at a loss of what to do.

1 Like

Any update on this?

I found this hack mentioned elsewhere on the forums that seems like it might help:
https://github.com/mopsicus/UnityMobileInput

Gonna give it a shot and report back

Edit: looks like this doesn’t work for TMP Input fields. welp, still waiting for this

up

Up, the ScreenKeyboard implementation on Android has been notorious for years. It makes input UX on Android universally bad. Users have been requesting, begging, and scolding for changes for a longggggggggggggggggggg time to no avail.

  • Form filling (for registration and such)
  • Chat behavior/app (need to tap 2 times to send a message)
  • Every UIs that uses more than 2 InputField
  • Every time user needs to interact with game elements or other UI when ScreenKeyboard is shown.
  • Screen Keyboard mess up the game life cycle because OnApplicationFocus got called for no good reason.
  • Basically, I think there is no Android game that uses InputField and does not suffer from the weirdness of ScreenKeyboard. Considering that Unity is most known for its dominance over the mobile market…

I understand that this is not the native behavior of Android’s keyboard but instead of wasting developers’ hours every time someone needs to implement something more complex with InputField, why couldn’t you make a hack for us? this is not even a feature but the most basic functionality that we expect from the engine, which is best known for its mobile game development.

I have been circumventing this with paid 3rd party tools but I hope for a better future of Unity where this particularly nasty papercut will be gone.

4 Likes

Has there been any progress on this, or are we forced to use 3rd party assets?

Another bump.

2 Likes

Is there any update on this? Implementing a chat feature and have tried almost everything.

@D4RKST4R007

I bought this asset OSK: On Screen Keyboard | Integration | Unity Asset Store …

It is a little dated but it was easy enough for me to update the UI and it has some code I was able to easily edit…

What I did for my needs is disable the built in keyboard and then just used this… no not ideal but it does give me full control over the keyboard…

bump

So does that mean at least one someone is working on this?

Can we get an updated comment about this so we know you guys still have eyes on it?

Thanks

Up +1

Up +1

Has anyone tried this solution with TMP in newer versions?

Cross-post for visibility - a solution to android:

I just tried it, and when setting closeKeyboardOnOutsideTap to false, tapping outside of the keyboard still hides it on 2020.3.26f1.

2 Likes

Yea this is pretty buggy atm - I just tested and it only works when you click on the input field again (as I think it just reopens it instantly). Anywhere else and it closes - but it does let you click stuff while closing the keyboard. So let’s say you have a back button in unity UI, you can now click that and it will actually fire, but the keyboard will still close.

Edit: Looks like the keyboard is hidden on pointer down.

Edit 2: Unity 2021.2.8f1