From 708ad2ffd156661eac18b6ea8d6a1572573cc1c8 Mon Sep 17 00:00:00 2001 From: Aleksandr Chermenin Date: Sun, 23 May 2021 18:59:58 +0500 Subject: [PATCH] Fixed gamepads --- systemstub_sdl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systemstub_sdl.cpp b/systemstub_sdl.cpp index 32d3684..da182be 100644 --- a/systemstub_sdl.cpp +++ b/systemstub_sdl.cpp @@ -131,12 +131,10 @@ void SystemStub_SDL::init(const char *title, int w, int h, bool fullscreen, int _controller = 0; if (SDL_NumJoysticks() > 0) { SDL_GameControllerAddMapping(Resource::_controllerMapping); + _joystick = SDL_JoystickOpen(kJoystickIndex); if (SDL_IsGameController(kJoystickIndex)) { _controller = SDL_GameControllerOpen(kJoystickIndex); } - if (!_controller) { - _joystick = SDL_JoystickOpen(kJoystickIndex); - } } _screenshot = 1; } @@ -671,6 +669,8 @@ void SystemStub_SDL::processEvent(const SDL_Event &ev, bool &paused) { case 3: _pi.backspace = pressed; break; + case 9: + _pi.escape = pressed; } } break;