From 14187f9311e9a9e9848dc8b59f84ac18f76bd888 Mon Sep 17 00:00:00 2001 From: ASL97 Date: Thu, 23 Feb 2017 05:18:21 +0800 Subject: [PATCH] Allow background joystick input on SDL --- SDL/SDLJoystick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL/SDLJoystick.cpp b/SDL/SDLJoystick.cpp index 36576d03b3..34a473b898 100644 --- a/SDL/SDLJoystick.cpp +++ b/SDL/SDLJoystick.cpp @@ -14,8 +14,8 @@ static int SDLJoystickEventHandlerWrapper(void* userdata, SDL_Event* event) } SDLJoystick::SDLJoystick(bool init_SDL ) : registeredAsEventHandler(false) { + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); if (init_SDL) { - SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER); }