WiimoteEmu: Require IRPassthrough has any bound inputs to operate. Users get confused and mistakenly enable it.

This commit is contained in:
Jordan Woyak
2025-10-04 14:34:49 -05:00
parent 72f854d228
commit 572459bc25
3 changed files with 10 additions and 6 deletions
@@ -3,15 +3,12 @@
#include "InputCommon/ControllerEmu/ControlGroup/IRPassthrough.h"
#include <memory>
#include <algorithm>
#include <string>
#include "Common/Common.h"
#include "Common/MathUtil.h"
#include "InputCommon/ControlReference/ControlReference.h"
#include "InputCommon/ControllerEmu/Control/Control.h"
#include "InputCommon/ControllerEmu/Control/Input.h"
namespace ControllerEmu
{
@@ -48,4 +45,10 @@ ControlState IRPassthrough::GetObjectSize(size_t object_index) const
return controls[object_index * 3 + 2]->GetState();
}
bool IRPassthrough::AreInputsBound() const
{
return std::ranges::any_of(
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
}
} // namespace ControllerEmu