From 48b69ca01841ba724049895a83d8d88ec95d66de Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 26 Feb 2019 19:46:21 -0600 Subject: ControllerInterface: Input detection improvements. --- Source/Core/InputCommon/ControllerInterface/Device.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (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 b8d73d9ab8..efe1372711 100644 --- a/Source/Core/InputCommon/ControllerInterface/Device.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Device.cpp @@ -4,6 +4,7 @@ #include "InputCommon/ControllerInterface/Device.h" +#include #include #include #include @@ -68,6 +69,11 @@ Device::Output* Device::FindOutput(const std::string& name) const return nullptr; } +ControlState Device::FullAnalogSurface::GetState() const +{ + return (1 + std::max(0.0, m_high.GetState()) - std::max(0.0, m_low.GetState())) / 2; +} + // // DeviceQualifier :: ToString // @@ -214,5 +220,5 @@ bool DeviceContainer::HasConnectedDevice(const DeviceQualifier& qualifier) const const auto device = FindDevice(qualifier); return device != nullptr && device->IsValid(); } -} -} +} // namespace Core +} // namespace ciface -- cgit v1.2.3