Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Help Wanted InputDeviceMatcher not working on Oculus Quest 2

Discussion in 'Input System' started by LHAppri, Nov 3, 2021.

  1. LHAppri

    LHAppri

    Joined:
    Aug 18, 2017
    Posts:
    18
    I have used RegisterLayout to setup identification for a home-grown HID following the Unity Manual https://docs.unity3d.com/Packages/c...483301.1603385957#overriding-the-hid-fallback

    ListLayouts shows the layouts as correctly registered on both the Editor & the Quest 2

    When run in the Unity Editor, the HID is correctly identified and the controls are listed correctly.
    When run on Oculus Quest 2, the HID is identified as AndroidJoystick and only standard AndroidJoystick controls are listed in InputDevice.allControls.
    Comparing the InputDevice.description.capabilities, the VendorID & ProductID are identical (which are the items the InputDeviceMatcher is based on) but MatchPercentage() gives a score of 0 on Quest compared to a score of 0.6 on Windows.
    It gives AndroidJoystick a MatchPercentage of 0.75 but I can't see how.

    Any ideas?
     
  2. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    204
    Hi, do you mean you pass raw HID data on Oculus somehow directly to Input System? Or you mean you pass HID data to Android, then Android converts it to motion events, and then you want to get your custom device class?

    For second case, because android reports same data for motion events, we do a bit of custom classification here https://github.com/Unity-Technologi...m/Plugins/Android/AndroidSupport.cs#L107-L161 this probably needs to be extended to inject more data. But our AndroidGamepad should be fairly universal, currently supporting 48 axes and 220 buttons, do you need more or you need other type of data?
     
unityunity