Oculus Quest, how to turn on the virtual keyboard in Unity development

Recently, I was doing a VR virtual meeting. When I used the input box and clicked on the input box, I needed to open the virtual keyboard. We mainly use Oculus, integrate the Oculus SDK, and also use MRTK as our component for developing 3D interfaces.

I am using the Unity2020.3.7 version and installed the Oculus Integration in the Package Manager.

 

MRTK : is a Microsoft -driven project that provides a set of components and functions to accelerate cross-platform MR application development in Unity .

MRTK provides TMP_KeyboardInputField, which can be used as an input box and can automatically call the virtual keyboard of the system. How to use it, please refer to Mixed Reality Keyboard - Mixed Reality Toolkit | Microsoft Docs

In the process of using it, the virtual keyboard cannot be called up in the Oculus quest.

After positioning, Oculus needs to enable the use of the system keyboard. How to enable the virtual keyboard? There are two ways.

Method 1: In the OculusProjectConfig configuration, check the Require System keyboard.

 

Method 2: Modify AndroidManifest.xml and add the use of Oculus overlay_keyboard.

Click Edit->Project Settings->Player->Publishing Settings, check Custom Main Manifest.

The specific content of AndroidManifest.xml is as follows:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.unity3d.player"
    xmlns:tools="http://schemas.android.com/tools">
    <application>
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:theme="@style/UnityThemeSelector">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        </activity>
    </application>
    <uses-feature android:name="oculus.software.overlay_keyboard" android:required="false"/>
</manifest>

In this way, you can open the virtual keyboard in Oculus. The last thing to note is that after completing the input, you need to click the GO key before the keyboard can disappear, otherwise the keyboard will not disappear.

 

references:

GitHub - Unity-Technologies/XR-Interaction-Toolkit-Examples: This repository contains various examples to use with the XR Interaction Toolkit

 

 

Guess you like

Origin blog.csdn.net/grace_yi/article/details/122630558