diff options
author | german77 <juangerman-13@hotmail.com> | 2023-05-20 05:19:29 +0200 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2023-05-20 05:19:29 +0200 |
commit | dbcdb3523bc12a461256d66fb853b6ef7b50ed66 (patch) | |
tree | 7b201999905346237c5e29b0c5f8e3f974e6b2cb | |
parent | Merge pull request #10344 from german77/pro-amiibo (diff) | |
download | yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.gz yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.bz2 yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.lz yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.xz yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.zst yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.zip |
-rw-r--r-- | src/input_common/input_engine.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp index 91aa96aa7..e4c5b5b3c 100644 --- a/src/input_common/input_engine.cpp +++ b/src/input_common/input_engine.cpp @@ -380,13 +380,16 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot if (!configuring || !mapping_callback.on_data) { return; } + const auto old_value = GetMotion(identifier, motion); bool is_active = false; - if (std::abs(value.accel_x) > 1.5f || std::abs(value.accel_y) > 1.5f || - std::abs(value.accel_z) > 1.5f) { + if (std::abs(value.accel_x - old_value.accel_x) > 1.5f || + std::abs(value.accel_y - old_value.accel_y) > 1.5f || + std::abs(value.accel_z - old_value.accel_z) > 1.5f) { is_active = true; } - if (std::abs(value.gyro_x) > 0.6f || std::abs(value.gyro_y) > 0.6f || - std::abs(value.gyro_z) > 0.6f) { + if (std::abs(value.gyro_x - old_value.gyro_x) > 0.6f || + std::abs(value.gyro_y - old_value.gyro_y) > 0.6f || + std::abs(value.gyro_z - old_value.gyro_z) > 0.6f) { is_active = true; } if (!is_active) { |