Opening keyboard while clicking inputField in VR (Oculus Quest 2 and XRIT)

Viewed 2397

I am currently developing a small app for oculus quest 2, using Unity. I've created a canvas, in which I've added a button and an InputField. By using the XR Interaction Toolkit, I am able to click on the button or the InputField with both of my controllers. However, it's still impossible to type anything into the InputField because when I click on it, any keyboard opens.

I've downloaded and explored the example project from git (https://github.com/Unity-Technologies/XR-Interaction-Toolkit-Examples) but I'm not using unity for a long time, so it looks impossible to find the settings (or script or anything else) that make it works.

Does anyone knows what should I do to open the keyboard when the InputField is clicked ? Also, will the text that I enter display in real time in the InputField ?

Thanks ! :)

EDIT : Apparently, it's not possible for the moment to use the oculus default keyboard, since the XRIT is not officially released.

2 Answers

What @Codemaker answered here is for Oculus Integration. For XR Interaction Toolkit, you can manually enable a keyboard instance, by doing the following.

private TouchScreenKeyboard keyboard;

public void ShowKeyboard()
{
   keyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default);
}

Just add this Showkeyboard() under the Inputfield's On Select () event. And you are done.

You can find the source here. I tried it and it works for me.

Related