|
|
@ -280,9 +280,9 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
button->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
button->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
connect(button, &QPushButton::clicked, [=] {
|
|
|
|
connect(button, &QPushButton::clicked, [=, this] {
|
|
|
|
HandleClick(button_map[button_id],
|
|
|
|
HandleClick(button_map[button_id],
|
|
|
|
[=](Common::ParamPackage params) {
|
|
|
|
[=, this](Common::ParamPackage params) {
|
|
|
|
// Workaround for ZL & ZR for analog triggers like on XBOX controllors.
|
|
|
|
// Workaround for ZL & ZR for analog triggers like on XBOX controllors.
|
|
|
|
// Analog triggers (from controllers like the XBOX controller) would not
|
|
|
|
// Analog triggers (from controllers like the XBOX controller) would not
|
|
|
|
// work due to a different range of their signals (from 0 to 255 on
|
|
|
|
// work due to a different range of their signals (from 0 to 255 on
|
|
|
@ -300,7 +300,8 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|
|
|
},
|
|
|
|
},
|
|
|
|
InputCommon::Polling::DeviceType::Button);
|
|
|
|
InputCommon::Polling::DeviceType::Button);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) {
|
|
|
|
connect(button, &QPushButton::customContextMenuRequested,
|
|
|
|
|
|
|
|
[=, this](const QPoint& menu_location) {
|
|
|
|
QMenu context_menu;
|
|
|
|
QMenu context_menu;
|
|
|
|
context_menu.addAction(tr("Clear"), [&] {
|
|
|
|
context_menu.addAction(tr("Clear"), [&] {
|
|
|
|
buttons_param[button_id].Clear();
|
|
|
|
buttons_param[button_id].Clear();
|
|
|
@ -323,16 +324,16 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
analog_button->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
analog_button->setContextMenuPolicy(Qt::CustomContextMenu);
|
|
|
|
connect(analog_button, &QPushButton::clicked, [=]() {
|
|
|
|
connect(analog_button, &QPushButton::clicked, [=, this] {
|
|
|
|
HandleClick(analog_map_buttons[analog_id][sub_button_id],
|
|
|
|
HandleClick(analog_map_buttons[analog_id][sub_button_id],
|
|
|
|
[=](const Common::ParamPackage& params) {
|
|
|
|
[=, this](const Common::ParamPackage& params) {
|
|
|
|
SetAnalogButton(params, analogs_param[analog_id],
|
|
|
|
SetAnalogButton(params, analogs_param[analog_id],
|
|
|
|
analog_sub_buttons[sub_button_id]);
|
|
|
|
analog_sub_buttons[sub_button_id]);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
InputCommon::Polling::DeviceType::Button);
|
|
|
|
InputCommon::Polling::DeviceType::Button);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
connect(analog_button, &QPushButton::customContextMenuRequested,
|
|
|
|
connect(analog_button, &QPushButton::customContextMenuRequested,
|
|
|
|
[=](const QPoint& menu_location) {
|
|
|
|
[=, this](const QPoint& menu_location) {
|
|
|
|
QMenu context_menu;
|
|
|
|
QMenu context_menu;
|
|
|
|
context_menu.addAction(tr("Clear"), [&] {
|
|
|
|
context_menu.addAction(tr("Clear"), [&] {
|
|
|
|
analogs_param[analog_id].Erase(analog_sub_buttons[sub_button_id]);
|
|
|
|
analogs_param[analog_id].Erase(analog_sub_buttons[sub_button_id]);
|
|
|
@ -350,21 +351,24 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
|
|
|
menu_location));
|
|
|
|
menu_location));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
connect(analog_map_stick[analog_id], &QPushButton::clicked, [=] {
|
|
|
|
connect(analog_map_stick[analog_id], &QPushButton::clicked, [=, this] {
|
|
|
|
if (QMessageBox::information(
|
|
|
|
if (QMessageBox::information(
|
|
|
|
this, tr("Information"),
|
|
|
|
this, tr("Information"),
|
|
|
|
tr("After pressing OK, first move your joystick horizontally, "
|
|
|
|
tr("After pressing OK, first move your joystick horizontally, "
|
|
|
|
"and then vertically."),
|
|
|
|
"and then vertically."),
|
|
|
|
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
|
|
|
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
|
|
|
|
HandleClick(
|
|
|
|
HandleClick(analog_map_stick[analog_id],
|
|
|
|
analog_map_stick[analog_id],
|
|
|
|
[=, this](const Common::ParamPackage& params) {
|
|
|
|
[=](const Common::ParamPackage& params) { analogs_param[analog_id] = params; },
|
|
|
|
analogs_param[analog_id] = params;
|
|
|
|
|
|
|
|
},
|
|
|
|
InputCommon::Polling::DeviceType::Analog);
|
|
|
|
InputCommon::Polling::DeviceType::Analog);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged, [=] {
|
|
|
|
connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged,
|
|
|
|
const float slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value();
|
|
|
|
[=, this] {
|
|
|
|
|
|
|
|
const float slider_value =
|
|
|
|
|
|
|
|
analog_map_deadzone_and_modifier_slider[analog_id]->value();
|
|
|
|
if (analogs_param[analog_id].Get("engine", "") == "sdl" ||
|
|
|
|
if (analogs_param[analog_id].Get("engine", "") == "sdl" ||
|
|
|
|
analogs_param[analog_id].Get("engine", "") == "gcpad") {
|
|
|
|
analogs_param[analog_id].Get("engine", "") == "gcpad") {
|
|
|
|
analog_map_deadzone_and_modifier_slider_label[analog_id]->setText(
|
|
|
|
analog_map_deadzone_and_modifier_slider_label[analog_id]->setText(
|
|
|
|