Add `allowJoystickBackgroundEvents` to config

This commit is contained in:
Phillip Stephens 2023-12-15 14:34:18 -08:00
parent 5589b24df6
commit 6f68612151
2 changed files with 4 additions and 2 deletions

View File

@ -57,6 +57,7 @@ typedef struct {
uint32_t msaa; uint32_t msaa;
uint16_t maxTextureAnisotropy; uint16_t maxTextureAnisotropy;
bool startFullscreen; bool startFullscreen;
bool allowJoystickBackgroundEvents;
int32_t windowPosX; int32_t windowPosX;
int32_t windowPosY; int32_t windowPosY;
uint32_t windowWidth; uint32_t windowWidth;

View File

@ -225,8 +225,9 @@ bool initialize() {
#endif #endif
SDL_DisableScreenSaver(); SDL_DisableScreenSaver();
/* TODO: Make this an option rather than hard coding it */ if (g_config.allowJoystickBackgroundEvents) {
SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
}
return true; return true;
} }