summaryrefslogtreecommitdiffstats
path: root/src/yuzu
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-08-11 17:08:10 +0200
committerLioncash <mathew1800@gmail.com>2020-08-13 20:19:08 +0200
commitb724a4d90c2dcff0e800f7ab630b6ad0d5be1e58 (patch)
tree8cf24f11888d563e7f00f79f5023876b9752c107 /src/yuzu
parentMerge pull request #4502 from lioncash/build (diff)
downloadyuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar.gz
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar.bz2
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar.lz
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar.xz
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.tar.zst
yuzu-b724a4d90c2dcff0e800f7ab630b6ad0d5be1e58.zip
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp61
-rw-r--r--src/yuzu/configuration/configure_mouse_advanced.cpp11
2 files changed, 38 insertions, 34 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index b1850bc95..597defe8c 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -281,24 +281,25 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(button, &QPushButton::clicked, [=, this] {
- HandleClick(button_map[button_id],
- [=, this](Common::ParamPackage params) {
- // Workaround for ZL & ZR for analog triggers like on XBOX controllors.
- // Analog triggers (from controllers like the XBOX controller) would not
- // work due to a different range of their signals (from 0 to 255 on
- // analog triggers instead of -32768 to 32768 on analog joysticks). The
- // SDL driver misinterprets analog triggers as analog joysticks.
- // TODO: reinterpret the signal range for analog triggers to map the
- // values correctly. This is required for the correct emulation of the
- // analog triggers of the GameCube controller.
- if (button_id == Settings::NativeButton::ZL ||
- button_id == Settings::NativeButton::ZR) {
- params.Set("direction", "+");
- params.Set("threshold", "0.5");
- }
- buttons_param[button_id] = std::move(params);
- },
- InputCommon::Polling::DeviceType::Button);
+ HandleClick(
+ button_map[button_id],
+ [=, this](Common::ParamPackage params) {
+ // Workaround for ZL & ZR for analog triggers like on XBOX controllors.
+ // Analog triggers (from controllers like the XBOX controller) would not
+ // work due to a different range of their signals (from 0 to 255 on
+ // analog triggers instead of -32768 to 32768 on analog joysticks). The
+ // SDL driver misinterprets analog triggers as analog joysticks.
+ // TODO: reinterpret the signal range for analog triggers to map the
+ // values correctly. This is required for the correct emulation of the
+ // analog triggers of the GameCube controller.
+ if (button_id == Settings::NativeButton::ZL ||
+ button_id == Settings::NativeButton::ZR) {
+ params.Set("direction", "+");
+ params.Set("threshold", "0.5");
+ }
+ buttons_param[button_id] = std::move(params);
+ },
+ InputCommon::Polling::DeviceType::Button);
});
connect(button, &QPushButton::customContextMenuRequested,
[=, this](const QPoint& menu_location) {
@@ -325,12 +326,13 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
analog_button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(analog_button, &QPushButton::clicked, [=, this] {
- HandleClick(analog_map_buttons[analog_id][sub_button_id],
- [=, this](const Common::ParamPackage& params) {
- SetAnalogButton(params, analogs_param[analog_id],
- analog_sub_buttons[sub_button_id]);
- },
- InputCommon::Polling::DeviceType::Button);
+ HandleClick(
+ analog_map_buttons[analog_id][sub_button_id],
+ [=, this](const Common::ParamPackage& params) {
+ SetAnalogButton(params, analogs_param[analog_id],
+ analog_sub_buttons[sub_button_id]);
+ },
+ InputCommon::Polling::DeviceType::Button);
});
connect(analog_button, &QPushButton::customContextMenuRequested,
[=, this](const QPoint& menu_location) {
@@ -357,11 +359,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
tr("After pressing OK, first move your joystick horizontally, "
"and then vertically."),
QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) {
- HandleClick(analog_map_stick[analog_id],
- [=, this](const Common::ParamPackage& params) {
- analogs_param[analog_id] = params;
- },
- InputCommon::Polling::DeviceType::Analog);
+ HandleClick(
+ analog_map_stick[analog_id],
+ [=, this](const Common::ParamPackage& params) {
+ analogs_param[analog_id] = params;
+ },
+ InputCommon::Polling::DeviceType::Analog);
}
});
diff --git a/src/yuzu/configuration/configure_mouse_advanced.cpp b/src/yuzu/configuration/configure_mouse_advanced.cpp
index ea2549363..5bcf5ffa8 100644
--- a/src/yuzu/configuration/configure_mouse_advanced.cpp
+++ b/src/yuzu/configuration/configure_mouse_advanced.cpp
@@ -84,11 +84,12 @@ ConfigureMouseAdvanced::ConfigureMouseAdvanced(QWidget* parent)
button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(button, &QPushButton::clicked, [=, this] {
- HandleClick(button_map[button_id],
- [=, this](const Common::ParamPackage& params) {
- buttons_param[button_id] = params;
- },
- InputCommon::Polling::DeviceType::Button);
+ HandleClick(
+ button_map[button_id],
+ [=, this](const Common::ParamPackage& params) {
+ buttons_param[button_id] = params;
+ },
+ InputCommon::Polling::DeviceType::Button);
});
connect(button, &QPushButton::customContextMenuRequested,
[=, this](const QPoint& menu_location) {