From d66be50226b2d1942f70df8e348f210b3e5d8a7c Mon Sep 17 00:00:00 2001 From: Mathew Tkachuk Date: Fri, 31 Jan 2025 23:54:34 +0300 Subject: [PATCH] feat: Add Pico G3 controller profile (#2679) * feat: Add Pico G3 controller profile * refactor: Use trackpad instead of thumbstick --- alvr/client_openxr/src/interaction.rs | 1 + alvr/common/src/inputs.rs | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/alvr/client_openxr/src/interaction.rs b/alvr/client_openxr/src/interaction.rs index 633883c96f..981ba9ed9a 100644 --- a/alvr/client_openxr/src/interaction.rs +++ b/alvr/client_openxr/src/interaction.rs @@ -136,6 +136,7 @@ impl InteractionContext { let controllers_profile_path = match platform { p if p.is_quest() => QUEST_CONTROLLER_PROFILE_PATH, // todo: create new controller profile for quest pro and 3 + Platform::PicoG3 => PICO_G3_CONTROLLER_PROFILE_PATH, Platform::PicoNeo3 => PICO_NEO3_CONTROLLER_PROFILE_PATH, Platform::Pico4Ultra => PICO4S_CONTROLLER_PROFILE_PATH, Platform::Pico4 | Platform::Pico4Pro | Platform::Pico4Enterprise => { diff --git a/alvr/common/src/inputs.rs b/alvr/common/src/inputs.rs index e875588d8b..f8ccba6df8 100644 --- a/alvr/common/src/inputs.rs +++ b/alvr/common/src/inputs.rs @@ -19,6 +19,7 @@ interaction_profile!(INDEX, "valve/index"); interaction_profile!(PICO_NEO3, "bytedance/pico_neo3"); interaction_profile!(PICO4, "bytedance/pico4"); interaction_profile!(PICO4S, "bytedance/pico4s"); +interaction_profile!(PICO_G3, "bytedance/pico_g3"); interaction_profile!(FOCUS3, "htc/vive_focus3"); interaction_profile!(YVR, "yvr/touch"); @@ -261,6 +262,30 @@ pub static CONTROLLER_PROFILE_INFO: Lazy> = .collect(), }, ), + ( + *PICO_G3_CONTROLLER_PROFILE_ID, + InteractionProfileInfo { + path: PICO_G3_CONTROLLER_PROFILE_PATH, + button_set: [ + *LEFT_MENU_CLICK_ID, + *LEFT_TRIGGER_CLICK_ID, + *LEFT_TRIGGER_VALUE_ID, + *LEFT_TRACKPAD_Y_ID, + *LEFT_TRACKPAD_X_ID, + *LEFT_TRACKPAD_CLICK_ID, + *LEFT_TRACKPAD_TOUCH_ID, + *RIGHT_MENU_CLICK_ID, + *RIGHT_TRIGGER_CLICK_ID, + *RIGHT_TRIGGER_VALUE_ID, + *RIGHT_TRACKPAD_Y_ID, + *RIGHT_TRACKPAD_X_ID, + *RIGHT_TRACKPAD_CLICK_ID, + *RIGHT_TRACKPAD_TOUCH_ID, + ] + .into_iter() + .collect(), + }, + ), ( *PICO_NEO3_CONTROLLER_PROFILE_ID, InteractionProfileInfo {