Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
AlienCurv's avatar
AlienCurv
Protege
4 years ago

Virtual keyboard not displaying with UI element (OVR 1.70.0)

I'm pulling my hair out - unable to get the virtual keyboard to display when I select a UI element. I'm probably missing something that maybe one of you will notice. This is the support document I'm following: Enable Keyboard Overlay | Oculus Developers

 

 

 

Requires system keyboard is checked. I can use the laser pointer to highlight text in the textbox, so the focus is working. Is there anything else I should need to be configured for the keyboard to display when a textbox UI element is focused?

 

6 Replies

Replies have been turned off for this discussion
  • Oh, I'm losing my mind on this one, haha. When I search google for "unity oculus quest 2 keyboard not showing", I get people who suggest checking the "requires system keyboard" option. But I have it checked, and no go. I must be missing something, but I can't figure out what. We have the app completed, and this is the only thing holding us from publishing. 

     

    Does anyone have suggestions of where I can look?

      • AlienCurv's avatar
        AlienCurv
        Protege

        I'm programmatically displaying the keyboard according to the keyboard overlay developer document. But, once the keyboard is displayed and DONE is pressed, the app loses focus forever. Pressing the menu button on the right controller causes the app to close and returns me to the main menu.

         

        Here's my code for the text input in the GUI canvas in an attempt to programmatically display an on-screen keyboard.

        using UnityEngine;
        using UnityEngine.UI;
        
        namespace MainMenu {
        
          public class tbIPAddress : MonoBehaviour {
        
            TouchScreenKeyboard _key;
        
            void Start() {
        
              GetComponent<InputField>().text = Assets.StaticVariables._IP_ADDRESS;
        
              GetComponent<InputField>().onValueChanged.AddListener(saveValue);
            }
        
            private void OnDestroy() {
        
              if (_key != null && _key.active)
                _key.active = false;
        
              GetComponent<InputField>().onValueChanged.RemoveAllListeners();
            }
        
            void saveValue(string v) {
        
              Assets.StaticVariables._IP_ADDRESS = v;
            }
        
            private void Update() {
        
              var tb = GetComponent<InputField>();
        
              if (tb.isFocused && (_key == null || !_key.active))
                _key = TouchScreenKeyboard.Open(Assets.StaticVariables._IP_ADDRESS, TouchScreenKeyboardType.DecimalPad);
        
              if (_key != null && _key.active)
                tb.text = _key.text;
            }
          }
        }