mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-05 01:42:41 +00:00
ControllerInterface: Input detection improvements.
This commit is contained in:
parent
13b2b93d3d
commit
48b69ca018
7 changed files with 90 additions and 60 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "InputCommon/ControllerInterface/Device.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue