From b8dd131af805b44dc6d2d7d8316d11c8e266404e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 2 Aug 2018 22:36:44 -0700 Subject: [PATCH] Allow gamepad input when the app doesn't have focus. Fixes #23 --- app/streaming/input.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/streaming/input.cpp b/app/streaming/input.cpp index 6e919450..5ea555f4 100644 --- a/app/streaming/input.cpp +++ b/app/streaming/input.cpp @@ -23,6 +23,9 @@ const int SdlInputHandler::k_ButtonMap[] = { SdlInputHandler::SdlInputHandler(bool multiController) : m_MultiController(multiController) { + // Allow gamepad input when the app doesn't have focus + SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + // We need to reinit this each time, since you only get // an initial set of gamepad arrival events once per init. SDL_assert(!SDL_WasInit(SDL_INIT_GAMECONTROLLER));