From 862fe13dcd72d21c04cbe79c38cab7df4b4a51a2 Mon Sep 17 00:00:00 2001 From: Muzychenko Andrey <33288308+k4zmu2a@users.noreply.github.com> Date: Mon, 1 Nov 2021 09:09:19 +0300 Subject: [PATCH] Added game controller exit shortcut: back/select when paused. Ref issue #79. --- SpaceCadetPinball/winmain.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SpaceCadetPinball/winmain.cpp b/SpaceCadetPinball/winmain.cpp index f6c38ff..1b9a4c6 100644 --- a/SpaceCadetPinball/winmain.cpp +++ b/SpaceCadetPinball/winmain.cpp @@ -776,7 +776,14 @@ int winmain::event_handler(const SDL_Event* event) case SDL_CONTROLLER_BUTTON_START: pause(); break; - default: ; + case SDL_CONTROLLER_BUTTON_BACK: + if (single_step) + { + SDL_Event event{ SDL_QUIT }; + SDL_PushEvent(&event); + } + break; + default:; } break; case SDL_CONTROLLERBUTTONUP: