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:
@@ -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 = [];
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user