diff options
Diffstat (limited to 'Source/Core/InputCommon/ControlReference/ControlReference.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControlReference/ControlReference.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/Source/Core/InputCommon/ControlReference/ControlReference.cpp b/Source/Core/InputCommon/ControlReference/ControlReference.cpp index af7536547c..b1dd5deee3 100644 --- a/Source/Core/InputCommon/ControlReference/ControlReference.cpp +++ b/Source/Core/InputCommon/ControlReference/ControlReference.cpp @@ -4,19 +4,18 @@ #include "InputCommon/ControlReference/ControlReference.h" -// For InputGateOn() -// This is a bad layering violation, but it's the cleanest -// place I could find to put it. -#include "Core/ConfigManager.h" -#include "Core/Host.h" - using namespace ciface::ExpressionParser; -bool ControlReference::InputGateOn() +static thread_local bool tls_input_gate = true; + +void ControlReference::SetInputGate(bool enable) +{ + tls_input_gate = enable; +} + +bool ControlReference::GetInputGate() { - return (SConfig::GetInstance().m_BackgroundInput || Host_RendererHasFocus() || - Host_UINeedsControllerState()) && - !Host_UIBlocksControllerState(); + return tls_input_gate; } // @@ -90,7 +89,7 @@ bool OutputReference::IsInput() const // ControlState InputReference::State(const ControlState ignore) { - if (m_parsed_expression && InputGateOn()) + if (m_parsed_expression && GetInputGate()) return m_parsed_expression->GetValue() * range; return 0.0; } |
