From 97abd3e1f92576fa826c59fbe10820f33920605d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 16 Jan 2024 21:40:20 +1000 Subject: [PATCH] ImGuiOverlays: Display inputs as integer, ignoring deadzone --- pcsx2/ImGui/ImGuiOverlays.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index da61d57e20..787c694ab0 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -509,22 +509,14 @@ void ImGuiManager::DrawInputsOverlay() { case InputBindingInfo::Type::Axis: case InputBindingInfo::Type::HalfAxis: - { - // axes are always shown - const float value = static_cast(pad->GetRawInput(bind)) * (1.0f / 255.0f); - if (value >= (254.0f / 255.0f)) - text.append_fmt(" {}", bi.icon_name ? bi.icon_name : bi.name); - else if (value > (1.0f / 255.0f)) - text.append_fmt(" {}: {:.2f}", bi.icon_name ? bi.icon_name : bi.name, value); - } - break; - case InputBindingInfo::Type::Button: { - // buttons only shown when active - const float value = static_cast(pad->GetRawInput(bind)) * (1.0f / 255.0f); - if (value >= 0.5f) + // axes are only shown if not resting/past deadzone + const u8 value = pad->GetEffectiveInput(bind); + if (value >= 254) text.append_fmt(" {}", bi.icon_name ? bi.icon_name : bi.name); + else if (value >= 1) + text.append_fmt(" {}: {}", bi.icon_name ? bi.icon_name : bi.name, value); } break;