summaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 631aa6ad2..6d5a3dead 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -957,7 +957,7 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback
957 raw_status.gyro.y.value, 957 raw_status.gyro.y.value,
958 raw_status.gyro.z.value, 958 raw_status.gyro.z.value,
959 }); 959 });
960 emulated.SetGyroThreshold(raw_status.gyro.x.properties.threshold); 960 emulated.SetUserGyroThreshold(raw_status.gyro.x.properties.threshold);
961 emulated.UpdateRotation(raw_status.delta_timestamp); 961 emulated.UpdateRotation(raw_status.delta_timestamp);
962 emulated.UpdateOrientation(raw_status.delta_timestamp); 962 emulated.UpdateOrientation(raw_status.delta_timestamp);
963 force_update_motion = raw_status.force_update; 963 force_update_motion = raw_status.force_update;
@@ -1284,6 +1284,26 @@ void EmulatedController::SetLedPattern() {
1284 } 1284 }
1285} 1285}
1286 1286
1287void EmulatedController::SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode) {
1288 for (auto& motion : controller.motion_values) {
1289 switch (mode) {
1290 case GyroscopeZeroDriftMode::Loose:
1291 motion_sensitivity = motion.emulated.IsAtRestLoose;
1292 motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose);
1293 break;
1294 case GyroscopeZeroDriftMode::Tight:
1295 motion_sensitivity = motion.emulated.IsAtRestThight;
1296 motion.emulated.SetGyroThreshold(motion.emulated.ThresholdThight);
1297 break;
1298 case GyroscopeZeroDriftMode::Standard:
1299 default:
1300 motion_sensitivity = motion.emulated.IsAtRestStandard;
1301 motion.emulated.SetGyroThreshold(motion.emulated.ThresholdStandard);
1302 break;
1303 }
1304 }
1305}
1306
1287void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles) { 1307void EmulatedController::SetSupportedNpadStyleTag(NpadStyleTag supported_styles) {
1288 supported_style_tag = supported_styles; 1308 supported_style_tag = supported_styles;
1289 if (!is_connected) { 1309 if (!is_connected) {