UWP, XboxOne, InputFields, and onscreen keyboards (or lack thereof)

I've been porting a large project to the XboxOne on the UWP platform. Our game uses "D3D", rather than "XAML", for performance reasons. I've been working with Unity 5.6.3p4 mostly, though all of the above seems to be true for 2017.2 as well.

I submitted a bug for an issue I've been struggling with: on this platform, selecting an InputField does not launch the On-Screen Keyboard (OSK) for text entry. Unity launches a touch keyboard automatically on mobile platforms (including, I think, UWP on Windows Phone)... but it definitely does not automatically handle text entry on Xbox One.

While TouchScreenKeyboard.isSupported reports FALSE on this platform, I found that using TouchScreenKeyboard.Open() does work for opening the OSK on this platform and retrieving the entered text after the user presses the Menu/submit button.

Using this to create a workaround seems like it would be trivial; and indeed doing that is what Unity rep Tautvydas-Zilys suggests in this forum thread.

However, there are two major issues I've had trying this, which aren't discussed elsewhere:

Cancelling the keyboard with the "B" button is completely not recognized by Unity. The keyboard disappears, and no other controller input is accepted; but the TouchScreenKeyboard instance, and the static variables, are all unchanged when this happens, so there's no way to detect this state. (Tried the "visible", "active", "done", "status", and "wasCanceled" flags, to no success.)

The OSK's text entry field is not shown (ie the white box above the keyboard that shows the text being entered). For our InputFields on the lower half of the screen, this means the player can't read the text they're entering.

So my question (preferably for a Unity dev) is: I successfully created a native plugin to let me fix #1. Do I have to do the same to fix #2?

More importantly, does Unity plan to implement this missing functionality? This is important UI functionality, and I assume the relatively few mentions of it on the forums only because there aren't very many XboxOne UWP games made in Unity. The keyboard can obviously be launched and used to some extent since TouchScreenKeyboard (mostly) functions; why isn't the full functionality there to do all this automatically, without the need for a native plugin and a workaround script?

This issue seems to imply that it's "by design" that D3D apps in UWP are unable to support the onscreen keyboard, and that this is only supported on XAML. However we need to use D3D, and we need this functionality.

I hope a Unity dev can advise on the right way to go here, or at least someone who's dealt with this problem and can confirm I'm going down a reasonable path with this workaround.

A year and a half after this bug was found, Unity has released new major versions (2018) but this bug is still there in D3D! This makes the Creators program from Microsoft via Unity completely useless in D3D. All Apps and Games need an onscreen keyboard.

I am curious as well. My project is still using a workaround script to bring this keyboard up and dismiss it; and bringing up the keyboard this way has at least one issue (it doesn't display the text entry, so for InputFields in the lower half of the screen, the player can't see the text they're entering as they're entering it).

And the workaround doesn't work for bringing up the OSK on Windows 10 at all. (Is that supported? It's something we'd like to do through the OS when the player is using a gamepad.)

Unity Technologies

And the workaround doesn't work for bringing up the OSK on Windows 10 at all. (Is that supported? It's something we'd like to do through the OS when the player is using a gamepad.)

Click to expand...

We don't have any support for it on the Standalone player. As for UWP, while we do have support for it, I don't think that will work. I believe Windows itself won't show a keyboard if a physical one is connected (at least that was the case few versions ago, I don't know if it changed). Feel free to report a bug if you think we should investigate this scenario further.

It seems it is still not possible to detect when the "B" or "Back" button is pressed and the OSK is dismissed. When dismissed, the TSK instance still shows Active as True and Status as Visible even though the keyboard is gone. Is this desired behavior? Is there another way to detect when the OSK is dismissed on Xbox One?

Unity Technologies

It seems it is still not possible to detect when the "B" or "Back" button is pressed and the OSK is dismissed. When dismissed, the TSK instance still shows Active as True and Status as Visible even though the keyboard is gone. Is this desired behavior? Is there another way to detect when the OSK is dismissed on Xbox One?

Unity Technologies

Sure, just tried it on 2018.2.17f1 and the issue still exists. Here's the case number for the bug report (it happens on the example project I made for the bug report too): 1104971

Another possibly related issue: once text is entered and the caret is moved with right/left bumper, entering new text will ignore the caret's position and will reset the caret to the end of the text and enter the text there. I assume this is not intended behavior either?

I am trying to build to android , and migrate around the app using a gamepad, everything works great, except InputFields. They dont work at all. I have been able to force the Keyboard to open like this ...

But, once the virtual keyboard opens, it can not be navigated with a controller at all. The controller is simply stuck between the text preview field , and the 'ok' button to submit the text.

Really frustrating, as this prevents anyone from using my app, ultimately making it a collosal waste of time, as it requires login and room creations with unique names, etc. And specifically targets Android / SHIELD TV.

I am trying to build to android , and migrate around the app using a gamepad, everything works great, except InputFields. They dont work at all. I have been able to force the Keyboard to open like this ...

But, once the virtual keyboard opens, it can not be navigated with a controller at all. The controller is simply stuck between the text preview field , and the 'ok' button to submit the text.

Really frustrating, as this prevents anyone from using my app, ultimately making it a collosal waste of time, as it requires login and room creations with unique names, etc. And specifically targets Android / SHIELD TV.

Any ideas or pointers guys?

Click to expand...

This thread/forum specifically discussed issues with UWP/Xbox One.I suggest posting on an android forum about this.

What scenario isn't working specifically? All known issues that were reported were fixed.

Click to expand...

Apologies for bumping and old thread, however, most of my google searches lead me here.

I am also having an issue. I can use the TouchScreenKeyboard class to open the on screen keyboard on an XB1 however I cannot seem to get it to display an input field and while I can get it to put the text into an input field. I cannot delete characters nor does pressing the view button or enter on the on screen keyboard close itself.

Unity Technologies

I am also having an issue. I can use the TouchScreenKeyboard class to open the on screen keyboard on an XB1 however I cannot seem to get it to display an input field and while I can get it to put the text into an input field. I cannot delete characters nor does pressing the view button or enter on the on screen keyboard close itself.

Click to expand...

I can't remember exactly, but I think input from keyboard on UWP comes from Input.inputString. Pressing backspace shows up as '\b' character.

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.