cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with the Keyboard overlay

Pascal-Teooh
Level 3

We're using the Keyboard overlay with Unity 2020.3.14 / Oculus XR Plugin 1.10.0pre2 / XR Plugin 4.0.7.

 

We have two related issues:

  1. When pressing the keyboard close button (bottom-right) the keyboard just reappears. It seem Unity never gets the focus back as I don't get a InputFocusAcquired event.
  2. The keyboard overlay doesn't seem to handle multiline fields properly. I would expect the tick button to become a return, but pressing this doesn't add a return and instead closes the keyboard, then re-opens it again and because of the previous issue with the close button means you are stuck in the keyboard overlay with no way out...

Both these issues happen with Unity UI InputFields & TMP versions.

 

Thanks,

Pascal.

11 REPLIES 11

Pascal-Teooh
Level 3

Thanks, a couple of things to try there. I'll let you know how I get on.

Pascal-Teooh
Level 3

Ok, so after a lot more digging, the keyboard close button bug is an issue with Unity's TouchScreenKeyboard implementation. 

 

The status property of this doesn't change when pressing the keyboard close button. You'd expect this to change to Canceled or LostFocus or even Done, but it just doesn't change from Visible.

 

Both the Unity UI & TMP Input field code rely on this property and so explains why they both fail / do nothing in the same way.

 

The Java code for Unity's TouchScreenKeyboard native implementation for Android isn't easily available / readable / replaceable but luckily I had already developed our own replacement for this in our standard Android app. For some reason I thought this wouldn't work on Quest, but the Quest keyboard is actually a standard Input Method Editor so works with my implementation too 🙂

 

To be fair to Unity, detecting the Android keyboard closing is not as simple as it sounds, but after lots of failed attempts, I've got a working solution by polling InputMethodManager.isActive passing in the EditText field as the view.

View solution in original post