From c693993748a8d34efbcbbe22bbaaa4e19419ac76 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 2 Feb 2026 15:41:09 +0100 Subject: [PATCH] Revert "Remove simple_controller binding for hand interaction" This reverts commit 1e2823c0196971caa9b32956a2bd0469b3c9da76. --- server/driver/wivrn_controller.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/server/driver/wivrn_controller.cpp b/server/driver/wivrn_controller.cpp index 3adbb542..c622e6aa 100644 --- a/server/driver/wivrn_controller.cpp +++ b/server/driver/wivrn_controller.cpp @@ -571,6 +571,21 @@ make_binding_profiles() constexpr auto controller_per_hand_binding_profiles = std::to_array({make_binding_profiles<0>(), make_binding_profiles<1>()}); +xrt_binding_input_pair hand_interaction_simple_input_binding[] = { + {XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_HAND_PINCH_VALUE}, + {XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_HAND_GRIP_POSE}, + {XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_HAND_AIM_POSE}, +}; + +xrt_binding_profile hand_interaction_binding_profiles[] = { + { + .name = XRT_DEVICE_SIMPLE_CONTROLLER, + .inputs = hand_interaction_simple_input_binding, + .input_count = std::size(hand_interaction_simple_input_binding), + .outputs = nullptr, + .output_count = 0, + }, +}; } // namespace wivrn_controller::wivrn_controller(xrt_device_name name, @@ -582,8 +597,8 @@ wivrn_controller::wivrn_controller(xrt_device_name name, .device_type = hand_id == 0 ? XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER : XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER, .hmd = nullptr, .tracking_origin = hmd->tracking_origin, - .binding_profile_count = name != XRT_DEVICE_EXT_HAND_INTERACTION ? controller_per_hand_binding_profiles[hand_id].size() : 0, - .binding_profiles = name != XRT_DEVICE_EXT_HAND_INTERACTION ? (struct xrt_binding_profile *)controller_per_hand_binding_profiles[hand_id].data() : nullptr, + .binding_profile_count = name != XRT_DEVICE_EXT_HAND_INTERACTION ? controller_per_hand_binding_profiles[hand_id].size() : std::size(hand_interaction_binding_profiles), + .binding_profiles = name != XRT_DEVICE_EXT_HAND_INTERACTION ? (struct xrt_binding_profile *)controller_per_hand_binding_profiles[hand_id].data() : hand_interaction_binding_profiles, .input_count = WIVRN_CONTROLLER_INPUT_COUNT, .supported = { .orientation_tracking = true,