Skip to content

Commit

Permalink
Motion Input: Add "enable" checkbox for motion controlled cursor.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlnilsen committed Nov 3, 2019
1 parent d67a230 commit f7a5054
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Source/Core/Core/HW/WiimoteEmu/Dynamics.cpp
Expand Up @@ -325,6 +325,12 @@ void EmulateIMUCursor(std::optional<RotationalState>* state, ControllerEmu::IMUC
// Avoid having to double dereference
auto& st = *state;

if (!imu_ir_group->enabled)
{
st = std::nullopt;
return;
}

auto accel = imu_accelerometer_group->GetState();
auto ang_vel = imu_gyroscope_group->GetState();

Expand Down
Expand Up @@ -18,7 +18,8 @@
namespace ControllerEmu
{
IMUCursor::IMUCursor(std::string name, std::string ui_name)
: ControlGroup(std::move(name), std::move(ui_name), GroupType::IMUCursor)
: ControlGroup(std::move(name), std::move(ui_name), GroupType::IMUCursor,
ControlGroup::CanBeDisabled::Yes)
{
controls.emplace_back(std::make_unique<Input>(Translate, _trans("Recenter")));

Expand Down

0 comments on commit f7a5054

Please sign in to comment.