diff --git a/src/osdep/gui/InGameMessage.cpp b/src/osdep/gui/InGameMessage.cpp index 504d6d25..586d8100 100644 --- a/src/osdep/gui/InGameMessage.cpp +++ b/src/osdep/gui/InGameMessage.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #endif #include "SelectorEntry.hpp" @@ -25,6 +26,7 @@ #include "inputdevice.h" + #ifdef ANDROIDSDL #include "androidsdl_event.h" #endif @@ -84,6 +86,10 @@ void checkInput() //------------------------------------------------- // Check user input //------------------------------------------------- + if (SDL_NumJoysticks() > 0) + if (GUIjoy == nullptr) + GUIjoy = SDL_JoystickOpen(0); + while (SDL_PollEvent(&msg_event)) { if (msg_event.type == SDL_KEYDOWN) @@ -121,6 +127,8 @@ void checkInput() msg_input->pushInput(msg_event); #endif } + if (GUIjoy) + SDL_JoystickClose(GUIjoy); } void gui_init(const char* msg)