Search Unity

Question Custom input action to use on XRController

Discussion in 'XR Interaction Toolkit and Input' started by dev_gonz, Mar 19, 2021.

  1. dev_gonz

    dev_gonz

    Joined:
    Oct 16, 2019
    Posts:
    10
    Hey everyone,

    Ive been researching a bit to try solve this problem but have come up short.

    I am currently developing with a Pico headset, and on the headset it has a 'confirm' button on the HMD that id like to use as a input action to interact with unity's UI system. That button from what ive seen isnt mapped to any of the default input actions that is part of the system, so therefor cant use it.

    The button maps to 'KeyCode.JoystickButton0', and i was wondering if there is a way to create a wrapper that would allow me to connect KeyCode.JoystickButton0 to a input action that can be used on the XR controllers.

    Any help would be greatly appreciated.

    Thanks!
     
  2. mikepavlou

    mikepavlou

    Joined:
    Aug 31, 2018
    Posts:
    2
    Hello, i am currently having the same issue, did u find any solution?
     
  3. VRDave_Unity

    VRDave_Unity

    Unity Technologies

    Joined:
    Nov 19, 2021
    Posts:
    275
    I took a look at the Pico SDK and documentation and it appears as though they have not implemented this button through their SDK. I also don't believe on-headset buttons are part of the OpenXR specification.

    In any case, with that aside, you could try adding an input binding for Joystick Trigger, as there is a good chance it might be mapped to the same input path as JoystickButton0, but allow for it to be used like the other input actions. Unfortunately I don't currently have access to a Pico device to test this theory, so I am curious what you discover.