Skip to content

Commit d3dc016

Browse files
committed
hello_xr: Use trigger/value for grabAction on vive_controller
Squeeze is a physical button on this controller. If possible, grabAction should be a float.
1 parent a763a74 commit d3dc016

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tests/hello_xr/openxr_program.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ struct OpenXrProgram : IOpenXrProgram {
414414
std::array<XrPath, Side::COUNT> hapticPath;
415415
std::array<XrPath, Side::COUNT> menuClickPath;
416416
std::array<XrPath, Side::COUNT> bClickPath;
417+
std::array<XrPath, Side::COUNT> triggerValuePath;
417418
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/select/click", &selectPath[Side::LEFT]));
418419
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/select/click", &selectPath[Side::RIGHT]));
419420
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/squeeze/value", &squeezeValuePath[Side::LEFT]));
@@ -428,6 +429,8 @@ struct OpenXrProgram : IOpenXrProgram {
428429
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/menu/click", &menuClickPath[Side::RIGHT]));
429430
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/b/click", &bClickPath[Side::LEFT]));
430431
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/b/click", &bClickPath[Side::RIGHT]));
432+
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/left/input/trigger/value", &triggerValuePath[Side::LEFT]));
433+
CHECK_XRCMD(xrStringToPath(m_instance, "/user/hand/right/input/trigger/value", &triggerValuePath[Side::RIGHT]));
431434
// Suggest bindings for KHR Simple.
432435
{
433436
XrPath khrSimpleInteractionProfilePath;
@@ -471,8 +474,8 @@ struct OpenXrProgram : IOpenXrProgram {
471474
XrPath viveControllerInteractionProfilePath;
472475
CHECK_XRCMD(
473476
xrStringToPath(m_instance, "/interaction_profiles/htc/vive_controller", &viveControllerInteractionProfilePath));
474-
std::vector<XrActionSuggestedBinding> bindings{{{m_input.grabAction, squeezeClickPath[Side::LEFT]},
475-
{m_input.grabAction, squeezeClickPath[Side::RIGHT]},
477+
std::vector<XrActionSuggestedBinding> bindings{{{m_input.grabAction, triggerValuePath[Side::LEFT]},
478+
{m_input.grabAction, triggerValuePath[Side::RIGHT]},
476479
{m_input.poseAction, posePath[Side::LEFT]},
477480
{m_input.poseAction, posePath[Side::RIGHT]},
478481
{m_input.quitAction, menuClickPath[Side::LEFT]},

0 commit comments

Comments
 (0)