Improve default WMR OpenXR bindings (#213)

* Bring back using dpad for click modifiers

* Use system button for show_hide on WMR controllers

---------

Co-authored-by: hare_ware <3469405-hare_ware@users.noreply.gitlab.com>
This commit is contained in:
Chris D
2025-05-16 16:01:53 -04:00
committed by GitHub
parent b543a6890e
commit af45138add
3 changed files with 23 additions and 8 deletions

View File

@@ -37,12 +37,19 @@ pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
} else {
log::warn!("Missing EXT_composition_layer_cylinder extension.");
}
if available_extensions.khr_composition_layer_equirect2 {
enabled_extensions.khr_composition_layer_equirect2 = true;
} else {
log::warn!("Missing EXT_composition_layer_equirect2 extension.");
}
if available_extensions
.other
.contains(&"XR_MNDX_system_buttons".to_owned())
{
enabled_extensions
.other
.push("XR_MNDX_system_buttons".to_owned());
}
//#[cfg(not(debug_assertions))]
let layers = [];

View File

@@ -452,7 +452,7 @@ fn is_bool(maybe_type_str: Option<&String>) -> bool {
.unwrap() // want panic
.split('/')
.next_back()
.is_some_and(|last| matches!(last, "click" | "touch"))
.is_some_and(|last| matches!(last, "click" | "touch") || last.starts_with("dpad_"))
}
macro_rules! add_custom {

View File

@@ -240,14 +240,22 @@
right: "/user/hand/right/input/thumbstick/x"
},
show_hide: {
left: "/user/hand/left/input/menu/click",
left: "/user/hand/left/input/system/click",
},
space_drag: {
right: "/user/hand/right/input/menu/click",
right: "/user/hand/right/input/system/click",
},
space_reset: {
double_click: true,
right: "/user/hand/right/input/menu/click",
right: "/user/hand/right/input/system/click",
},
click_modifier_right: {
left: "/user/hand/left/input/trackpad/dpad_up",
right: "/user/hand/right/input/trackpad/dpad_up"
},
click_modifier_middle: {
left: "/user/hand/left/input/trackpad/dpad_down",
right: "/user/hand/right/input/trackpad/dpad_down"
},
},
@@ -279,14 +287,14 @@
right: "/user/hand/right/input/thumbstick/x"
},
show_hide: {
left: "/user/hand/left/input/menu/click",
left: "/user/hand/left/input/system/click",
},
space_drag: {
right: "/user/hand/right/input/menu/click",
right: "/user/hand/right/input/system/click",
},
space_reset: {
double_click: true,
right: "/user/hand/right/input/menu/click",
right: "/user/hand/right/input/system/click",
},
},