From 2c8ecc3ea7906647eff45739360ee91efc07092c Mon Sep 17 00:00:00 2001 From: jasaaved Date: Sun, 26 Apr 2026 14:19:59 -0700 Subject: [PATCH] FullscreenUI: Remove diagonal navigation Removing diagonal navigation makes moving across titles feel smoother and works closer to Steam's big picture mode. --- pcsx2/ImGui/ImGuiManager.cpp | 49 ++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/pcsx2/ImGui/ImGuiManager.cpp b/pcsx2/ImGui/ImGuiManager.cpp index 5d982fa4f4..0eddd04a39 100644 --- a/pcsx2/ImGui/ImGuiManager.cpp +++ b/pcsx2/ImGui/ImGuiManager.cpp @@ -1217,6 +1217,21 @@ bool ImGuiManager::ProcessGenericInputEvent(GenericInputBinding key, InputLayout if (static_cast(key) >= std::size(key_map) || key_map[static_cast(key)] == ImGuiKey_None) return false; + // Ignore diagonal D-pad input — neither direction fires when both axes are held simultaneously. + static bool s_dpad_h_held = false, s_dpad_v_held = false; + const bool is_dpad_h = (key == GenericInputBinding::DPadLeft || key == GenericInputBinding::DPadRight); + const bool is_dpad_v = (key == GenericInputBinding::DPadUp || key == GenericInputBinding::DPadDown); + if (is_dpad_h || is_dpad_v) + { + if (is_dpad_h) + s_dpad_h_held = (value > 0.0f); + else + s_dpad_v_held = (value > 0.0f); + + if (s_dpad_h_held && s_dpad_v_held) + return false; + } + MTGS::RunOnGSThread( [key = key_map[static_cast(key)], value, layout]() mutable { if (s_gamepad_swap_noth_west) @@ -1238,11 +1253,41 @@ void ImGuiManager::ProcessGenericAxisEvent(GenericInputBinding negative_key, Gen { static constexpr float DEADZONE = 0.25f; + // Ignore diagonal analog stick input — neither axis fires when both exceed the deadzone. + static float s_left_stick_x = 0.0f, s_left_stick_y = 0.0f; + static float s_right_stick_x = 0.0f, s_right_stick_y = 0.0f; + + float suppressed_value = value; + if (negative_key == GenericInputBinding::LeftStickLeft) + { + s_left_stick_x = value; + if (std::abs(s_left_stick_y) > DEADZONE) + suppressed_value = 0.0f; + } + else if (negative_key == GenericInputBinding::LeftStickUp) + { + s_left_stick_y = value; + if (std::abs(s_left_stick_x) > DEADZONE) + suppressed_value = 0.0f; + } + else if (negative_key == GenericInputBinding::RightStickLeft) + { + s_right_stick_x = value; + if (std::abs(s_right_stick_y) > DEADZONE) + suppressed_value = 0.0f; + } + else if (negative_key == GenericInputBinding::RightStickUp) + { + s_right_stick_y = value; + if (std::abs(s_right_stick_x) > DEADZONE) + suppressed_value = 0.0f; + } + // Treat as binary like the D-pad: either fully pressed or released, with a deadzone. if (negative_key != GenericInputBinding::Unknown) - ProcessGenericInputEvent(negative_key, layout, (value < -DEADZONE) ? 1.0f : 0.0f); + ProcessGenericInputEvent(negative_key, layout, (suppressed_value < -DEADZONE) ? 1.0f : 0.0f); if (positive_key != GenericInputBinding::Unknown) - ProcessGenericInputEvent(positive_key, layout, (value > DEADZONE) ? 1.0f : 0.0f); + ProcessGenericInputEvent(positive_key, layout, (suppressed_value > DEADZONE) ? 1.0f : 0.0f); } void ImGuiManager::SwapGamepadNorthWest(bool value)