The open source OpenXR runtime

d/psmv: Add basic touch bindings

this lets you play a lot of games, like beat saber

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2519>

+32 -3
+32 -3
src/xrt/drivers/psmv/psmv_driver.c
··· 1009 1009 * 1010 1010 */ 1011 1011 1012 - static struct xrt_binding_input_pair simple_inputs[4] = { 1012 + static struct xrt_binding_input_pair simple_inputs[] = { 1013 1013 {XRT_INPUT_SIMPLE_SELECT_CLICK, XRT_INPUT_PSMV_TRIGGER_VALUE}, 1014 1014 {XRT_INPUT_SIMPLE_MENU_CLICK, XRT_INPUT_PSMV_MOVE_CLICK}, 1015 1015 {XRT_INPUT_SIMPLE_GRIP_POSE, XRT_INPUT_PSMV_GRIP_POSE}, 1016 1016 {XRT_INPUT_SIMPLE_AIM_POSE, XRT_INPUT_PSMV_AIM_POSE}, 1017 1017 }; 1018 1018 1019 - static struct xrt_binding_output_pair simple_outputs[1] = { 1019 + static struct xrt_binding_output_pair simple_outputs[] = { 1020 1020 {XRT_OUTPUT_NAME_SIMPLE_VIBRATION, XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION}, 1021 1021 }; 1022 1022 1023 - static struct xrt_binding_profile binding_profiles[1] = { 1023 + static struct xrt_binding_input_pair touch_inputs[] = { 1024 + {XRT_INPUT_TOUCH_X_CLICK, XRT_INPUT_PSMV_CROSS_CLICK}, 1025 + {XRT_INPUT_TOUCH_X_TOUCH, XRT_INPUT_PSMV_CROSS_CLICK}, 1026 + {XRT_INPUT_TOUCH_Y_CLICK, XRT_INPUT_PSMV_SQUARE_CLICK}, 1027 + {XRT_INPUT_TOUCH_Y_TOUCH, XRT_INPUT_PSMV_SQUARE_CLICK}, 1028 + {XRT_INPUT_TOUCH_MENU_CLICK, XRT_INPUT_PSMV_PS_CLICK}, 1029 + {XRT_INPUT_TOUCH_A_CLICK, XRT_INPUT_PSMV_CIRCLE_CLICK}, 1030 + {XRT_INPUT_TOUCH_A_TOUCH, XRT_INPUT_PSMV_CIRCLE_CLICK}, 1031 + {XRT_INPUT_TOUCH_B_CLICK, XRT_INPUT_PSMV_TRIANGLE_CLICK}, 1032 + {XRT_INPUT_TOUCH_B_TOUCH, XRT_INPUT_PSMV_TRIANGLE_CLICK}, 1033 + {XRT_INPUT_TOUCH_SYSTEM_CLICK, XRT_INPUT_PSMV_PS_CLICK}, 1034 + {XRT_INPUT_TOUCH_SQUEEZE_VALUE, XRT_INPUT_PSMV_START_CLICK}, 1035 + {XRT_INPUT_TOUCH_TRIGGER_TOUCH, XRT_INPUT_PSMV_TRIGGER_VALUE}, 1036 + {XRT_INPUT_TOUCH_TRIGGER_VALUE, XRT_INPUT_PSMV_TRIGGER_VALUE}, 1037 + {XRT_INPUT_TOUCH_GRIP_POSE, XRT_INPUT_PSMV_GRIP_POSE}, 1038 + {XRT_INPUT_TOUCH_AIM_POSE, XRT_INPUT_PSMV_AIM_POSE}, 1039 + }; 1040 + 1041 + static struct xrt_binding_output_pair touch_outputs[] = { 1042 + {XRT_OUTPUT_NAME_TOUCH_HAPTIC, XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION}, 1043 + }; 1044 + 1045 + static struct xrt_binding_profile binding_profiles[] = { 1046 + { 1047 + .name = XRT_DEVICE_TOUCH_CONTROLLER, 1048 + .inputs = touch_inputs, 1049 + .input_count = ARRAY_SIZE(touch_inputs), 1050 + .outputs = touch_outputs, 1051 + .output_count = ARRAY_SIZE(touch_outputs), 1052 + }, 1024 1053 { 1025 1054 .name = XRT_DEVICE_SIMPLE_CONTROLLER, 1026 1055 .inputs = simple_inputs,