[Release Blocker] Input text doesn't show keyboard

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

1 Like

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

1 Like

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.

1 Like

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 :man_facepalming:t2:

I’ll follow up with the team next week about the status of keyboard for VR.

1 Like

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

1 Like

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.

1 Like

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.

1 Like

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.

1 Like

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?