From d4879da95cb9e8143eab0a6b3098b886044f9b32 Mon Sep 17 00:00:00 2001 From: capitalists Date: Sat, 10 Sep 2022 23:32:17 +0000 Subject: [PATCH] Implement analog triggers for DSUController (#239) --- src/input/api/DSU/DSUController.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/input/api/DSU/DSUController.cpp b/src/input/api/DSU/DSUController.cpp index 33e16dbf..1a961a4a 100644 --- a/src/input/api/DSU/DSUController.cpp +++ b/src/input/api/DSU/DSUController.cpp @@ -164,5 +164,8 @@ ControllerState DSUController::raw_state() result.rotation.y = (float)state.data.ry / std::numeric_limits::max(); result.rotation.y = (result.rotation.y * 2.0f) - 1.0f; - return result; + result.trigger.x = (float)state.data.l2 / std::numeric_limits::max(); + result.trigger.y = (float)state.data.r2 / std::numeric_limits::max(); + + return result; }