Search Unity

Resolved How do I detect Oculus Menu press without opening Steam Vr?

Discussion in 'VR' started by AndreiTache, Jun 24, 2022.

  1. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    Hi, I want to detect when the player presses the menu button on the left controller of an Oculus Quest 2, but the button opens Steam Vr instead of passing the input.

    I'm using the new Input System, and I added a second binding to another button on the controller to trigger the same function to make sure it was not a problem with my code.

    Is it possible to stop Steam Vr opening when pressing the button?
     
  2. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    Using bindings from OpenXR or Oculus XR doesn't seem to help either
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,049
  4. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Dont use steamvr for your oculus builds, you give up a button when you do that. Use oculus xr plug-in or make sure user or yourself uses oculus as the openxr runtime.
     
    DevDunk likes this.
  5. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    Thanks, but I'm looking for a way to still use the button in-game, not just know if the menu is open or not

    Oh really, so I should use both plug-ins in the project and switch them out when building the game? That seems like quite the headache :)
    I'll experiment with it and see how it goes, thanks for the idea
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,049
    You cannot override the menu button, both for oculus (rift/quest) and steamvr. You can read the input however
     
  7. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    How can I read the input? For me it opens the steam menu, but the game doesn't get the input
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,049
    Did you read my reply?
     
  9. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    I did, I don't want to override it, I want to get the input, which you said I could
     
  10. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,049
  11. AndreiTache

    AndreiTache

    Joined:
    Nov 8, 2014
    Posts:
    31
    Yea, checking if the app lost focus seems pretty kludgy tho, but it seems like I have to either do it that way, or switch to the oculus plugin. I'll test them both out and see which works best.
    Thanks for the tip
     
  12. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,049
    Best to use OpenXR with XR Interaction Toolkit of you want a long term project