Search Unity

Occulus Quest - Input.GetKeyDown() not firing when TMPInputField is active

Discussion in 'VR' started by Raijen, May 20, 2020.

  1. Raijen

    Raijen

    Joined:
    Apr 30, 2013
    Posts:
    1
    Hey everyone,

    I'm developing a VR App for Occulus Quest, using a Keyboard connected over Bluetooth.
    The user writes into a TMPInputField, which is activated via script:
    Code (CSharp):
    1. public TMP_InputField inputField;
    2. ...
    3. inputField.ActivateInputField();
    Simultaniously, I would like to use
    Code (CSharp):
    1. Input.GetKeyDown()
    to keep track of every key on the keyboard. This works fine when I run my project in the editor - I can type into the InputField, and the
    Code (CSharp):
    1. Input.GetKeyDown()
    events are being fired.

    However, running the same code on my Occulus Quest does not work - when the InputField is focused, I can type into it, but no events are being fired.
    I verifyed this by using
    Code (CSharp):
    1. inputField.DeactivateInputField();
    - and the events are being fired.

    I could imagine developing a workaround for this by manually editing the
    Code (CSharp):
    1. inputField.text
    for every key being pressed - seems kinda brute force though.

    Am I missing something basic or is this a bug (Occulus Quest Bluetooth device support still being an experimental feature) ?

    Thank you for your time :)
     
    Last edited: Jun 5, 2020
  2. azimmerman

    azimmerman

    Joined:
    Mar 10, 2020
    Posts:
    9
    Did you ever figure this out? I am currently trying to figure out why e.g. `UnityEngine.Input.GetKeyDown` does not seem to be working with the system keyboard on the Oculus Quest 2, also while focused on a `UIElements.TextField` which I think has a TextMeshPro `InputField` actually handling the input.