Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question TouchScreenKeyboard.Open() not working after Asset API update

Discussion in 'VR' started by Smithurst, Jan 14, 2022.

  1. Smithurst

    Smithurst

    Joined:
    Jul 8, 2020
    Posts:
    1
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using TMPro;
    5.  
    6. public class ShowKeyboard : MonoBehaviour
    7. {
    8.     private TouchScreenKeyboard overlayKeyboard;
    9.     private string inputText = "";
    10.     public GameObject inputBox;
    11.     // Start is called before the first frame update
    12.     void Start()
    13.     {
    14.         overlayKeyboard = TouchScreenKeyboard.Open("", TouchScreenKeyboardType.Default);
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     public void Update()
    19.     {
    20.         if(overlayKeyboard != null)
    21.         {
    22.             inputText = overlayKeyboard.text;
    23.             inputBox.GetComponent<TextMeshProUGUI>().text = inputText;
    24.         }
    25.     }
    26. }
    I have the OVR Manager script on my XRRig with the "Requires System Keyboard" checked and on my input field, I have the ShowKeyboard script - code can be seen above and an onSelect() on the input field calling the ShowKeyboard.Update().
    This is the code I used and it worked yesterday but since I did the Asset API Update today it will not show the keyboard in my VR environment. Can anyone help me either revert the Asset API update or help find a way for the code to work with the current update.
     
  2. RobertCoomber

    RobertCoomber

    Joined:
    Mar 25, 2017
    Posts:
    14
    I've recently tried to implement the overlay keyboard like this and I am also not able to get it working. Using V40. I also used the provided UI demo scene and I am not able to get the keyboard pop up on standalone quest and in the editor.