Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
vishalbharti.433800's avatar
5 months ago

Keyboard Input Not Working on InputField with Ray Interaction on Canvas (Unity XR/Meta Development)

ello everyone,

I'm developing an application in Unity 6 latest version using the Meta XR All-in-One SDK (latest version). I'm encountering a frustrating issue for some timewith an InputField (specifically TMP_InputField) on my UI Canvas.

The Problem:
I have a UI Canvas set up with a TMP_InputField. I'm using the ray interaction provided by the Meta XR SDK to interact with UI elements on this Canvas.

When I use the ray interactor to click on the TMP_InputField, a blinking cursor appears inside it, as expected. However, I am unable to type anything using my physical keyboard.

Crucially, if I temporarily disable the ray interaction component on the Canvas (or the OVR Raycaster if that's the one), I can type into the InputField perfectly fine. This strongly suggests a conflict between the Meta XR ray interaction system and standard keyboard input getting routed to the InputField.

My Setup Details:

  • Unity Version: Unity 6
  • XR Setup: Meta XR All-in-One SDK
  • InputField Type: TMP_InputField (TextMeshPro InputField - TMPro.TMP_InputField)
  • Canvas Configuration:
    • I've made the Canvas itself "ray interactable" via right clicking on canvas and adding "ray interaction to canvas".

What I've Tried So Far (and related issues):

  1. Making Canvas Ray Interactable: Confirmed the Canvas is reachable and clickable via the ray interactor.
  2. TMP_InputField "Interactable" Property: The TMP_InputField component's "Interactable" checkbox is checked.
  3. Basic Interaction: Clicking with the ray does make the cursor appear, indicating some level of interaction.

Request for Help:

  1. Why would Ray Interaction on the Canvas prevent standard keyboard input from reaching the TMP_InputField? Is it consuming all input events, or is there a specific Event System configuration needed for coexistence?
  2. What's the recommended approach within the Meta XR All-in-One SDK and Unity 6 for handling TMP_InputField keyboard input when using ray interactors? Are there specific settings that need adjustment?
  3. Could there be a conflict with the active Input Module in the Event System GameObject? What configuration should I aim for when using Meta XR?
  4. Is there a way to temporarily disable the OVR Raycaster (or similar component) when the TMP_InputField is focused, and re-enable it when it loses focus? If so, what is the best way to get a reference to the specific raycaster component?

Any insights, debugging tips, or specific configurations for the Meta XR SDK or Event System in Unity 6 that might resolve this would be extremely helpful.

Please help me in resolving this issue.

 

3 Replies

Replies have been turned off for this discussion
  • saadk's avatar
    saadk
    Meta Employee

    Hi! 

    Are you using multiple active Input Modules? Unity generally works with a single input module active at a time. The Interaction SDK uses PointableCanvasModule .. which currently does not process mouse/keyboard input (we have a custom version in a sample project that supports this). 

    You can use the sample project using the CusomtPointableCanvasModule for reference as a stop gap. This works with the old input system or if 'both' are active in the player settings. If you're exclusively using the new input system then you'll need to modify the script to extend from InputSystemUIInputModule instead of StandaloneInputModule :
    Project link : Tracked Keyboard Sample

    Additionally, there is an issue with the TMP input field in Unity (losing focus) using a physical keyboard/mouse that you might run into when running your apk on the device  : 
    https://discussions.unity.com/t/android-tmp-inputfield-with-bluetooth-keyboard-or-mouse/1642865


    Hope that helps! : ) 

  • Thanks a lot!

    I used Tracked keyboard Sample you provided. The caret is not rendering even though the input field gets active after i build the apk but when i play in unity the caret is rendering, how do i tackle this issue?