Created empty project and added text box, but a virtual keyboard is not showing up. Last blocker to release an app. We want user to be able to input their name and other information
Make sure the canvas is set to world space and that your Input System UI Input Module
is properly configured for the input package.
After creating a TMP Input field it should look like this
Click that button at the bottom so it looks like this
Thanks for the steps, but I tried it and it doesnât appear to be working.
Do I need to add anything to the TMP Input field? I just added âinput system UI input moduleâ to the eventsystem. Edit: I tried adding it to the text box and it doesnât seem to be working either.
Do you have a demo project? Iâm able to click the text input, but no keyboard shows up still. Happens in editor and on device.
Apple Vision Pro XR Plugin 1.0.3
Text Mesh Pro 3.0.7
XR Interaction Toolkit 2.5.2
I was able to get it working. If you havenât yet try upgrading to Unity 2022.3.19f1 (I think a change might have landed there that enables it).
Either way hereâs a project zip.
was that on MR? It works well on MR, but fails to even load anything on device in VR or in the simulator
Yeah, sorry I totally missed this was related to a VR project
Iâll follow up with the team next week about the status of keyboard for VR.
Can you wake up the virtual keyboard in VR? I really need itďźďź
Iâve followed up internally, itâs currently not supported due to a platform limitation with how we support Fully Immersive Apps (VR). Weâre trying to find a solution but it wonât be in the next package release.
Itâs not ideal but in the interim I recommend creating your own virtual keyboard.
We are using the following GitHub - Ayfel/MRTK-Keyboard: Standalone version of MRTK NonNative Keyboard
I just ripped it out of MRTK so it can be used anywhere. Feel free to grab it for your own use
Really? No keyboard input in VR mode? Am I reading this correctly?
Kind of a big problem for us ⌠canât log in users without a keyboard. Iâve spent the last couple of days trying to troubleshoot. Guess that was a waste of time.
That is correct. Weâre working with Apple to find a way to enable this functionality but so far we havenât found a way to invoke the virtual keyboard without a View in the scene. VR apps using CompositorServices do not require a View
, and in order for one to be visible and show the keyboard, it needs to be in an open SwiftUI window or volume. This comes with its own problems, and even an empty volume will render the white capsule and X button âchromeâ on top of your VR layer.
In the meantime, you should be able to use a virtual keyboard package like CutieKeys or the solution shared by @Alex_Heizenrader above to handle the virtual keyboard entirely within Unity. You may have to adapt the input for these packages to use the pinch/gaze gesture or ARKit hand tracking. I understand this isnât ideal, but itâs the best we can do at the moment due to the unique constraints of visionOS.
Just a note here for anyone else curious. Using your own virtual keyboard comes with significant downsides. Because you donât have access to gaze until click, users donât really get any UI indication of which key theyâre about to press, which is a pretty jank input experience and very unintuitive given theyâre probably used to the native keyboard implementation.
Thanks for bringing this up. While youâre right that there are significant drawbacks, it should still be possible to use gaze based input by hooking the virtual keyboard up to VisionOSSpatialPointerDevice
. This wonât work out of the box (and you wonât be able to implement a hover state), but depending on how input is set up in the keyboard youâre using, it may be do-able, and worth the effort.
But youâre absolutely right⌠using a custom virtual keyboard is far from ideal. Most of the existing solutions Iâm aware of donât include predictive text, dictation, and other important features provided by the native keyboard. We absolutely want to expose this functionality for VR experiences, and appreciate your patience while we work with Apple to find a solution.
I wasnât able to get the virtual keyboard to appear with this sample project. Only the WASD keys are functional and they just move the position of the camera in the Vision Pro Simulator when connected to Play to Device.
Is there a setting that I am missing somewhere to see the virtual keyboard?
Hi @Alex_Heizenrader. Did you test it on Vision Pro device? It works in unity editor, but on device app crashes when I click on input field.
EDIT:
I managed to fix it by commenting out the line:
InputField.ActivateInputField();
in PresentKeyboard() method in NonNativeKeyboard.
Yes, sorry on the late reply. It works for us with no issue on full immersive VR, I havenât tested in MR, and maybe it needs a workaround like you mention.
Can fully immersive VR work with the Magic Keyboard?