summaryrefslogtreecommitdiff
path: root/src/input_common/input_engine.cpp
diff options
context:
space:
mode:
authorGravatar german772023-05-19 21:19:29 -0600
committerGravatar german772023-05-19 21:19:29 -0600
commitdbcdb3523bc12a461256d66fb853b6ef7b50ed66 (patch)
tree7b201999905346237c5e29b0c5f8e3f974e6b2cb /src/input_common/input_engine.cpp
parentMerge pull request #10344 from german77/pro-amiibo (diff)
downloadyuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.gz
yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.tar.xz
yuzu-dbcdb3523bc12a461256d66fb853b6ef7b50ed66.zip
input_common: Map motion with relative values not absolute ones
Diffstat (limited to 'src/input_common/input_engine.cpp')
-rw-r--r--src/input_common/input_engine.cpp11
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
380 if (!configuring || !mapping_callback.on_data) { 380 if (!configuring || !mapping_callback.on_data) {
381 return; 381 return;
382 } 382 }
383 const auto old_value = GetMotion(identifier, motion);
383 bool is_active = false; 384 bool is_active = false;
384 if (std::abs(value.accel_x) > 1.5f || std::abs(value.accel_y) > 1.5f || 385 if (std::abs(value.accel_x - old_value.accel_x) > 1.5f ||
385 std::abs(value.accel_z) > 1.5f) { 386 std::abs(value.accel_y - old_value.accel_y) > 1.5f ||
387 std::abs(value.accel_z - old_value.accel_z) > 1.5f) {
386 is_active = true; 388 is_active = true;
387 } 389 }
388 if (std::abs(value.gyro_x) > 0.6f || std::abs(value.gyro_y) > 0.6f || 390 if (std::abs(value.gyro_x - old_value.gyro_x) > 0.6f ||
389 std::abs(value.gyro_z) > 0.6f) { 391 std::abs(value.gyro_y - old_value.gyro_y) > 0.6f ||
392 std::abs(value.gyro_z - old_value.gyro_z) > 0.6f) {
390 is_active = true; 393 is_active = true;
391 } 394 }
392 if (!is_active) { 395 if (!is_active) {