Add a setting to allow for joystick input to work while not in focus.

This commit is contained in:
Felipe Otamendi 2015-01-13 23:36:25 -02:00
parent 08c2c561ca
commit 33d6733d64
2 changed files with 5 additions and 0 deletions

View file

@ -1,5 +1,6 @@
#include "InputManager.h"
#include "InputConfig.h"
#include "Settings.h"
#include "Window.h"
#include "Log.h"
#include "pugixml/pugixml.hpp"
@ -45,6 +46,9 @@ void InputManager::init()
if(initialized())
deinit();
if (Settings::getInstance()->getBool("BackgroundJoystickInput")){
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
}
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
SDL_JoystickEventState(SDL_ENABLE);

View file

@ -39,6 +39,7 @@ void Settings::setDefaults()
mBoolMap.clear();
mIntMap.clear();
mBoolMap["BackgroundJoystickInput"] = false;
mBoolMap["ParseGamelistOnly"] = false;
mBoolMap["DrawFramerate"] = false;
mBoolMap["ShowExit"] = true;