From 4abfa3c3ac090b7475d338444d5fe4119ccc0967 Mon Sep 17 00:00:00 2001 From: galister <22305755+galister@users.noreply.github.com> Date: Sun, 9 Jun 2024 00:19:42 +0900 Subject: [PATCH] fix double-click hold not working on OpenXR --- src/backend/openxr/input.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/openxr/input.rs b/src/backend/openxr/input.rs index 0bc055f..fd75d4b 100644 --- a/src/backend/openxr/input.rs +++ b/src/backend/openxr/input.rs @@ -84,7 +84,9 @@ impl CustomClickAction { let res = self .action_bool_double .state(&state.session, xr::Path::NULL)?; - if res.is_active && self.check_double_click(res.current_state) { + if res.is_active + && ((before && res.current_state) || self.check_double_click(res.current_state)) + { return Ok(true); } @@ -100,7 +102,10 @@ impl CustomClickAction { } let res = self.action_f32.state(&state.session, xr::Path::NULL)?; - if res.is_active && self.check_double_click(res.current_state > threshold) { + if res.is_active + && ((before && res.current_state > threshold) + || self.check_double_click(res.current_state > threshold)) + { return Ok(true); }