How to detect Universal Menu through OpenXR?

Meta’s VRC.Quest.Input.4 requires that VR hands stop rendering and ignore input when the Universal Menu is active. I also need to pause the game correctly when the button is pressed.
I’ve tried using the input manager to handle right controller menu presses but it doesn’t work.9908241--1431720--upload_2024-6-25_12-10-26.png
Some forum posts said the Unity.XR.Oculus.InputFocus could help, but I’m using OpenXR and the InputFocusAcquired/InputFocusLost events don’t seem to be launched at all.

The right menu button is reserved by the OS I believe, which is why input events aren’t working.

Focus events not working sounds like a bug however. You can report it via Help → Report a bug…

I’m running into the same issue. I need to detect when the Steam menu or Oculus Link/Rift menu is opened or closed when using XR Plugin Management with OpenXR.

For Quest builds, I have “Oculus” selected in the XR Plugin Management settings and I can detect when the Universal Menu is opened or closed via these events:

Unity.XR.Oculus.InputFocus.InputFocusAcquired
Unity.XR.Oculus.InputFocus.InputFocusLost

And that way I can hide the player hand models when the Universal Menu is open. For PC builds I’m using the OpenXR runtime and I’m having a hard time finding the equivalent way to detect when the VR system menu is opened on PC.

@aidanboch did you ever figure it out?

Does anyone else know how to do this?

EDIT: I posted an answer to this one here. You need to use:

UnityEngine.XR.InputDevices.GetDeviceAtXRNode(XRNode.Head).TryGetFeatureValue(CommonUsages.userPresence, out bool isPresent);
1 Like