From dce6cf6c14edb3df7e0d4ea8652710a7cc1ef22e Mon Sep 17 00:00:00 2001 From: spatialfree Date: Sat, 23 Nov 2024 16:24:18 -0500 Subject: [PATCH] select(trigger or the a btn) and back btn for consistent understandable input across devices --- src/Rig.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Rig.cs b/src/Rig.cs index 0dcad8a..058080e 100644 --- a/src/Rig.cs +++ b/src/Rig.cs @@ -6,8 +6,9 @@ static class Rig { public static Pose head = Pose.Identity; - public static DeltaBool btn_trigger = new(false); + public static DeltaBool btn_select = new(false); public static DeltaBool btn_grip = new(false); + public static DeltaBool btn_back = new(false); public static Vec3 fullstick = Vec3.Up; public static Pose r_con_stick = Pose.Identity; @@ -26,7 +27,8 @@ static class Rig // flatscreen dev controls if (Device.Name == "Simulator") { - btn_trigger.Step(Input.Key(Key.MouseLeft).IsActive()); + btn_select.Step(Input.Key(Key.MouseLeft).IsActive()); + btn_back.Step(Input.Key(Key.MouseRight).IsActive()); if (Input.Key(Key.A).IsJustActive()) new_dir = new(-1, 0, 0); if (Input.Key(Key.S).IsJustActive()) new_dir = new(+1, 0, 0); @@ -46,8 +48,9 @@ static class Rig // bool hand_tracked = Input.HandSource(Handed.Right) > HandSource.None; if (con_tracked) { - btn_trigger.Step(r_con.trigger > 0.5f); + btn_select.Step(r_con.x1.IsActive() || r_con.trigger > 0.5f); btn_grip.Step(r_con.grip > 0.5f); + btn_back.Step(r_con.x2.IsActive()); Vec2 stick = r_con.stick; Quat stick_rot = Quat.FromAngles(stick.y * -90, 0, stick.x * +90);