Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. Raijen


    Apr 30, 2013
    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