summaryrefslogtreecommitdiffstats
path: root/src/input_common
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-01-08 09:06:15 +0100
committerGitHub <noreply@github.com>2022-01-08 09:06:15 +0100
commit26f4e92c1fa5486f4047990ee7351f18f7fe4f1c (patch)
tree592c31594566b2f933f358b79a7b44380fa2515b /src/input_common
parentMerge pull request #7658 from ameerj/sparse-fixes (diff)
parentcore/hid: Set minimum gyro threshold (diff)
downloadyuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar.gz
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar.bz2
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar.lz
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar.xz
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.tar.zst
yuzu-26f4e92c1fa5486f4047990ee7351f18f7fe4f1c.zip
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/input_engine.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp
index 9c17ca4f7..b57330e51 100644
--- a/src/input_common/input_engine.cpp
+++ b/src/input_common/input_engine.cpp
@@ -298,8 +298,16 @@ void InputEngine::TriggerOnMotionChange(const PadIdentifier& identifier, int mot
if (!configuring || !mapping_callback.on_data) {
return;
}
- if (std::abs(value.gyro_x) < 0.6f && std::abs(value.gyro_y) < 0.6f &&
- std::abs(value.gyro_z) < 0.6f) {
+ 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) {
+ 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) {
+ is_active = true;
+ }
+ if (!is_active) {
return;
}
mapping_callback.on_data(MappingData{