diff --git a/docs/quest.md b/docs/quest.md index 968618ff6..9a60f6587 100644 --- a/docs/quest.md +++ b/docs/quest.md @@ -74,6 +74,9 @@ and display timing, and returns owned stereo images with their render poses. SteamVR haptics return through the tracking bridge. No root or separate XR APK is required. Other devices retain their existing SteamVR start behavior. +The left Touch menu button is SteamVR's system button and toggles its dashboard. +The right Meta button remains reserved by the headset OS. + The panel compositor detaches before OpenXR starts displaying guest frames. Session suspension accounts for the immersive activity while the panel is hidden. Closing the immersive activity stops SteamVR. The panel remains available for diff --git a/tools/vr/src/driver_droiddeck.cpp b/tools/vr/src/driver_droiddeck.cpp index 6bcd9537f..77ed8eb7c 100644 --- a/tools/vr/src/driver_droiddeck.cpp +++ b/tools/vr/src/driver_droiddeck.cpp @@ -455,8 +455,8 @@ public: driverInput->UpdateScalarComponent(padY_, input.stickY, 0); driverInput->UpdateBooleanComponent(padClick_, input.stickClick, 0); driverInput->UpdateBooleanComponent(padTouch_, input.stickTouch, 0); - driverInput->UpdateBooleanComponent(menu_, input.menuClick, 0); - driverInput->UpdateBooleanComponent(system_, false, 0); + driverInput->UpdateBooleanComponent(menu_, false, 0); + driverInput->UpdateBooleanComponent(system_, input.systemClick, 0); if (xrMode_) { driverInput->UpdateScalarComponent(gripValue_, input.grip, 0); driverInput->UpdateBooleanComponent(triggerTouch_, input.triggerTouch, 0); diff --git a/tools/vr/src/xr_touch_input.h b/tools/vr/src/xr_touch_input.h index d35273396..496ce5830 100644 --- a/tools/vr/src/xr_touch_input.h +++ b/tools/vr/src/xr_touch_input.h @@ -6,7 +6,7 @@ struct XrTouchInput { float trigger = 0, grip = 0, stickX = 0, stickY = 0; bool triggerClick = false, gripClick = false, stickClick = false; - bool primaryClick = false, secondaryClick = false, menuClick = false; + bool primaryClick = false, secondaryClick = false, systemClick = false; bool triggerTouch = false, stickTouch = false, primaryTouch = false, secondaryTouch = false, thumbrestTouch = false; }; @@ -23,7 +23,7 @@ inline XrTouchInput xr_touch_input(const DroidDeckXrHand &hand, bool right) { input.stickClick = hand.buttons & DROIDDECK_XR_STICK_CLICK; input.primaryClick = hand.buttons & DROIDDECK_XR_PRIMARY_CLICK; input.secondaryClick = hand.buttons & DROIDDECK_XR_SECONDARY_CLICK; - input.menuClick = !right && (hand.buttons & DROIDDECK_XR_MENU_CLICK); + input.systemClick = !right && (hand.buttons & DROIDDECK_XR_MENU_CLICK); input.triggerTouch = hand.buttons & DROIDDECK_XR_TRIGGER_TOUCH; input.stickTouch = hand.buttons & DROIDDECK_XR_STICK_TOUCH; input.primaryTouch = hand.buttons & DROIDDECK_XR_PRIMARY_TOUCH; diff --git a/tools/vr/tests/test_xr_touch.cpp b/tools/vr/tests/test_xr_touch.cpp index 24e86a45c..0d8f8f62d 100644 --- a/tools/vr/tests/test_xr_touch.cpp +++ b/tools/vr/tests/test_xr_touch.cpp @@ -11,19 +11,21 @@ int main() { auto input = xr_touch_input(hand, false); assert(input.trigger == hand.trigger && input.grip == hand.squeeze && input.triggerClick && input.gripClick); assert(input.stickX == -0.4f && input.stickY == 0.9f); - assert(!input.stickTouch && !input.stickClick && !input.primaryClick && !input.secondaryClick && !input.menuClick); + assert(!input.stickTouch && !input.stickClick && !input.primaryClick && !input.secondaryClick && !input.systemClick); hand.buttons = DROIDDECK_XR_PRIMARY_CLICK; input = xr_touch_input(hand, false); - assert(input.primaryClick && !input.secondaryClick && !input.stickClick && !input.menuClick && !input.primaryTouch); + assert(input.primaryClick && !input.secondaryClick && !input.stickClick && !input.systemClick && !input.primaryTouch); hand.buttons = DROIDDECK_XR_SECONDARY_CLICK; input = xr_touch_input(hand, true); - assert(input.secondaryClick && !input.primaryClick && !input.menuClick && !input.stickClick); + assert(input.secondaryClick && !input.primaryClick && !input.systemClick && !input.stickClick); hand.buttons = DROIDDECK_XR_STICK_CLICK; input = xr_touch_input(hand, true); assert(input.stickClick && !input.primaryClick && !input.stickTouch); hand.buttons = DROIDDECK_XR_MENU_CLICK; - assert(xr_touch_input(hand, false).menuClick); - assert(!xr_touch_input(hand, true).menuClick); + assert(xr_touch_input(hand, false).systemClick); + assert(!xr_touch_input(hand, true).systemClick); + hand.buttons = 0; + assert(!xr_touch_input(hand, false).systemClick); hand.buttons = DROIDDECK_XR_TRIGGER_TOUCH | DROIDDECK_XR_STICK_TOUCH | DROIDDECK_XR_PRIMARY_TOUCH | DROIDDECK_XR_SECONDARY_TOUCH | DROIDDECK_XR_THUMBREST_TOUCH; hand.trigger = hand.squeeze = 0; @@ -43,7 +45,7 @@ int main() { hand.trigger = hand.squeeze = hand.stick[0] = hand.stick[1] = 1; input = xr_touch_input(hand, false); assert(input.trigger == 0 && input.grip == 0 && input.stickX == 0 && input.stickY == 0); - assert(!input.triggerClick && !input.gripClick && !input.stickClick && !input.primaryClick && !input.secondaryClick && !input.menuClick); + assert(!input.triggerClick && !input.gripClick && !input.stickClick && !input.primaryClick && !input.secondaryClick && !input.systemClick); assert(!input.triggerTouch && !input.stickTouch && !input.primaryTouch && !input.secondaryTouch && !input.thumbrestTouch); - std::puts("Touch input: independent face/stick/menu, real capacitive touch, analog grip, clamping and inactive reset passed"); + std::puts("Touch input: independent face/stick/system, real capacitive touch, analog grip, clamping and inactive reset passed"); }