Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Virtual Keyboard - Oculus GO

graves3dgraves3d Posts: 5

We are implementing a virtual keyboard for the oculus go using Unity's Native UI system (UGUI). We've modified OVRInputModule to support the Oculus GO controller and we are able to interact with UGUI elements.
 Our problem is, whenever you click an input field it shows a native android input field, which in VR, looks like a white bar at the bottom of the user's view.

What is the recommended approach on how to 1) not have the native android input field show up,  and 2) have the input field behave as it would in a desktop VR application.


  • rohal_chandrakarrohal_chandrakar Posts: 2
    Even I am Facing the same problem. the keyboard appears in the bottom and rotates  with camera
  • wilk3nswilk3ns Posts: 1
    Any answers regarding how to implement native android keyboard into Oculus GO App??
  • tkeene_vspatialtkeene_vspatial Posts: 7
    edited November 2018
    I am having this issue as well. Using Unity's input fields with the Curved UI plugin. A white or green bar appears at the bottom of the headset's field of view (press the headset closer to your face to get a good look at it) whenever an input field has focus. This occurs even if the Hide Mobile Input box is checked.
  • emilien.degutemilien.degut Posts: 6
    I have the same issue @tkeene_vspatial : a green bar appear at the bottom of my Oculus GO. Have you solved your issu?
  • riyarathi00riyarathi00 Posts: 1
    please give any solution I am facing same problem  :(
  • perceptimageryperceptimagery Posts: 2
    yunhan0 said:
    I solved this issue by writing a class inherits from the input field. So remove the default InputField component and attach the MobileInput. Don't forget to assign some properties such as TextComponent and Placeholder inside the new MobileInput Component.
    using UnityEngine;
    using UnityEngine.UI;
    public class MobileInput : InputField
        protected override void Start()
            keyboardType = (TouchScreenKeyboardType)(-1);

    hi @yunhan0
    If you remove the Touch screen keyboard (obviously as there is no screen), what do you use along with the new MobileInput class to type? Do you use any specific VR keyboard? I am trying to find one that'd work with Oculus Go.
  • yunhan0yunhan0 Posts: 3
    Hi @perceptimagery ,
    The solution I provided above is not working. I've dived into the input field source code and can confirm that without assigning a touch screen keyboard, the input field won't behave well, such as missing caret.
    My final solution is to write a completely customised input field to get rid of the builtin android keyboard.
    Also, The keyboard I use the VR keyboard in this package (I'm also the creator of this package). 
  • shane_harrisshane_harris Posts: 1
    edited April 8
    @perceptimagery ; @yunhan0
    I may have a solution to this problem involving overrides and reflection:
    using System.Reflection;
    using UnityEngine;
    using UnityEngine.EventSystems;
    using UnityEngine.UI;
    public class GoInputField : InputField {
        private void ActivateInputFieldInternal() {
            if (EventSystem.current == null)
            if (EventSystem.current.currentSelectedGameObject != gameObject)
            if (TouchScreenKeyboard.isSupported) {
                if (GetBaseInput().touchSupported) {
                    TouchScreenKeyboard.hideInput = shouldHideMobileInput;
                // Here is where the touchscreen keyboard is opened - we exclude 
                // the calls to TouchScreenKeyboard.Open()
                // https://bitbucket.org/Unity-Technologies/ui/src/9f418c4767c47d0c71f1727eb42a9a9024e9ecc0/UnityEngine.UI/UI/Core/InputField.cs#lines-2252:2254
            } else {
                GetBaseInput().imeCompositionMode = IMECompositionMode.On;
            SetField("m_AllowInput", true);
            SetField("m_OriginalText", text);
            SetField("m_WasCanceled", false);
        protected override void LateUpdate() {
            bool _m_ShouldActivateNextUpdate = GetField("m_ShouldActivateNextUpdate");
            if (_m_ShouldActivateNextUpdate) {
                if (!isFocused) {
                    SetField("m_ShouldActivateNextUpdate", false);
                SetField("m_ShouldActivateNextUpdate", false);
            // Here this method usually handles all the TouchScreenKeyboard checks and 
            // deselets the InputField if the keyboard is not visible - lets not do that.
            // https://bitbucket.org/Unity-Technologies/ui/src/9f418c4767c47d0c71f1727eb42a9a9024e9ecc0/UnityEngine.UI/UI/Core/InputField.cs#lines-773:865
        BaseInput GetBaseInput() {
            // Shim this method rather than use reflection, we have access to the EventSystem anyway. 
            if (EventSystem.current && EventSystem.current.currentInputModule)
                return EventSystem.current.currentInputModule.input;
            return null;
        private BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance;
        void SetField(string name, T value) {
            GetType().BaseType.GetField(name, flags).SetValue(this, value);
        T GetField(string name) {
            return (T)GetType().BaseType.GetField(name, flags).GetValue(this);
        public void CallMethod(string name) {
            GetType().BaseType.GetMethod(name, flags).Invoke(this, null);
    There are obvious flaws in this approach - its not really reliable to expect this to work with other versions of Unity other than the version I'm using - 2018.2.X. Thankfully the Unity UI is open source so using the links included in the comments above you could convert this to another version without too much hassle. I hope this helps some others too and maybe unity could implement a fix too. I will point them to this implementation however and who knows, we could see a fix.

Sign In or Register to comment.