summaryrefslogtreecommitdiffstats
path: root/src/yuzu/configuration/configure_input_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu/configuration/configure_input_player.cpp')
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index 7029287a9..752504236 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -403,10 +403,22 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
connect(button, &QPushButton::customContextMenuRequested,
[=, this](const QPoint& menu_location) {
QMenu context_menu;
+ Common::ParamPackage param = emulated_controller->GetMotionParam(motion_id);
context_menu.addAction(tr("Clear"), [&] {
emulated_controller->SetMotionParam(motion_id, {});
motion_map[motion_id]->setText(tr("[not set]"));
});
+ if (param.Has("motion")) {
+ context_menu.addAction(tr("Set gyro threshold"), [&] {
+ const int gyro_threshold =
+ static_cast<int>(param.Get("threshold", 0.007f) * 1000.0f);
+ const int new_threshold = QInputDialog::getInt(
+ this, tr("Set threshold"), tr("Choose a value between 0% and 100%"),
+ gyro_threshold, 0, 100);
+ param.Set("threshold", new_threshold / 1000.0f);
+ emulated_controller->SetMotionParam(motion_id, param);
+ });
+ }
context_menu.exec(motion_map[motion_id]->mapToGlobal(menu_location));
});
}