input_common: Add support for analog toggle

This commit is contained in:
Narr the Reg
2022-09-06 11:20:53 -05:00
parent 199f77b92f
commit 2898be69f4
4 changed files with 15 additions and 0 deletions

View File

@ -382,6 +382,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
button_map[button_id]->setText(ButtonToText(param));
emulated_controller->SetButtonParam(button_id, param);
});
context_menu.addAction(tr("Toggle axis"), [&] {
const bool toggle_value = !param.Get("toggle", false);
param.Set("toggle", toggle_value);
button_map[button_id]->setText(ButtonToText(param));
emulated_controller->SetButtonParam(button_id, param);
});
context_menu.addAction(tr("Set threshold"), [&] {
const int button_threshold =
static_cast<int>(param.Get("threshold", 0.5f) * 100.0f);