Merge pull request #7640 from jordan-woyak/input-fixes

ControllerInterface: Output/Rumble fixes
This commit is contained in:
JMC47
2019-01-05 17:16:35 -05:00
committed by GitHub
7 changed files with 237 additions and 125 deletions

View File

@ -12,6 +12,9 @@
namespace MappingCommon
{
constexpr int INPUT_DETECT_TIME = 3000;
constexpr int OUTPUT_DETECT_TIME = 2000;
QString GetExpressionForControl(const QString& control_name,
const ciface::Core::DeviceQualifier& control_device,
const ciface::Core::DeviceQualifier& default_device, Quote quote)
@ -41,7 +44,9 @@ QString GetExpressionForControl(const QString& control_name,
QString DetectExpression(ControlReference* reference, ciface::Core::Device* device,
const ciface::Core::DeviceQualifier& default_device, Quote quote)
{
ciface::Core::Device::Control* const ctrl = reference->Detect(5000, device);
const int ms = reference->IsInput() ? INPUT_DETECT_TIME : OUTPUT_DETECT_TIME;
ciface::Core::Device::Control* const ctrl = reference->Detect(ms, device);
if (ctrl)
{