From 74f308338195ac6c78008def5a6a4342c8b824af Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 11 Jul 2014 10:53:51 -0400 Subject: ControllerInterface: Gate the input based on our new background input setting --- Source/Core/InputCommon/ControllerInterface/Device.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/Device.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/Device.cpp b/Source/Core/InputCommon/ControllerInterface/Device.cpp index e1383efc9d..61057c8162 100644 --- a/Source/Core/InputCommon/ControllerInterface/Device.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Device.cpp @@ -5,6 +5,12 @@ #include #include +// For InputGateOn() +// This is a really bad layering violation, but it's the cleanest +// place I could find to put it. +#include "Core/ConfigManager.h" +#include "Core/Host.h" + #include "InputCommon/ControllerInterface/Device.h" namespace ciface @@ -74,6 +80,16 @@ void Device::ClearInputState() // kinda slow but, w/e, should only happen when user unplugs a device while playing } +bool Device::Control::InputGateOn() +{ + if (SConfig::GetInstance().m_BackgroundInput) + return true; + else if (Host_RendererHasFocus()) + return true; + else + return false; +} + // // DeviceQualifier :: ToString // -- cgit v1.2.3