ControllerInterface: Gate the input based on our new background input setting

This commit is contained in:
Jasper St. Pierre
2014-07-11 10:53:51 -04:00
parent 5abc028ace
commit 74f3083381
3 changed files with 36 additions and 2 deletions

View File

@ -5,6 +5,12 @@
#include <sstream>
#include <string>
// 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
//