From 11e0ccd85409f167ef7d2d24c69508a678da0502 Mon Sep 17 00:00:00 2001 From: staphen Date: Sun, 9 Jul 2023 10:35:05 -0400 Subject: [PATCH] Invoke padmap release handler in menus --- Source/controls/game_controls.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/controls/game_controls.cpp b/Source/controls/game_controls.cpp index 4ef74a99b..d4fa00513 100644 --- a/Source/controls/game_controls.cpp +++ b/Source/controls/game_controls.cpp @@ -375,14 +375,17 @@ bool HandleControllerButtonEvent(const SDL_Event &event, const ControllerButtonE SuppressedButton = ControllerButton_NONE; } - if (GetGameAction(event, ctrlEvent, &action)) { + if (ctrlEvent.up && sgOptions.Padmapper.ActionNameTriggeredByButtonEvent(ctrlEvent) != "") { + // Button press may have brought up a menu; + // don't confuse release of that button with intent to interact with the menu + sgOptions.Padmapper.ButtonReleased(ctrlEvent.button); + return true; + } else if (GetGameAction(event, ctrlEvent, &action)) { ProcessGameAction(action); return true; } else if (ctrlEvent.button != ControllerButton_NONE) { if (!ctrlEvent.up) PressControllerButton(ctrlEvent.button); - else - sgOptions.Padmapper.ButtonReleased(ctrlEvent.button); return true; }