diff options
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index a968cfb5d..bfb14bb43 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -247,7 +247,22 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 247 | connect(button, &QPushButton::clicked, [=] { | 247 | connect(button, &QPushButton::clicked, [=] { |
| 248 | HandleClick( | 248 | HandleClick( |
| 249 | button_map[button_id], | 249 | button_map[button_id], |
| 250 | [=](const Common::ParamPackage& params) { buttons_param[button_id] = params; }, | 250 | [=](Common::ParamPackage params) { |
| 251 | // Workaround for ZL & ZR for analog triggers like on XBOX controllors. | ||
| 252 | // Analog triggers (from controllers like the XBOX controller) would not work | ||
| 253 | // due to a different range of their signals (from 0 to 255 on analog triggers | ||
| 254 | // instead of -32768 to 32768 on analog joysticks). The SDL driver misinterprets | ||
| 255 | // analog triggers as analog joysticks. | ||
| 256 | // TODO: reinterpret the signal range for analog triggers to map the values | ||
| 257 | // correctly. This is required for the correct emulation of the analog triggers | ||
| 258 | // of the GameCube controller. | ||
| 259 | if (button_id == Settings::NativeButton::ZL || | ||
| 260 | button_id == Settings::NativeButton::ZR) { | ||
| 261 | params.Set("direction", "+"); | ||
| 262 | params.Set("threshold", "0.5"); | ||
| 263 | } | ||
| 264 | buttons_param[button_id] = params; | ||
| 265 | }, | ||
| 251 | InputCommon::Polling::DeviceType::Button); | 266 | InputCommon::Polling::DeviceType::Button); |
| 252 | }); | 267 | }); |
| 253 | connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { | 268 | connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { |
| @@ -274,12 +289,13 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 274 | 289 | ||
| 275 | analog_button->setContextMenuPolicy(Qt::CustomContextMenu); | 290 | analog_button->setContextMenuPolicy(Qt::CustomContextMenu); |
| 276 | connect(analog_button, &QPushButton::clicked, [=]() { | 291 | connect(analog_button, &QPushButton::clicked, [=]() { |
| 277 | HandleClick(analog_map_buttons[analog_id][sub_button_id], | 292 | HandleClick( |
| 278 | [=](const Common::ParamPackage& params) { | 293 | analog_map_buttons[analog_id][sub_button_id], |
| 279 | SetAnalogButton(params, analogs_param[analog_id], | 294 | [=](const Common::ParamPackage& params) { |
| 280 | analog_sub_buttons[sub_button_id]); | 295 | SetAnalogButton(params, analogs_param[analog_id], |
| 281 | }, | 296 | analog_sub_buttons[sub_button_id]); |
| 282 | InputCommon::Polling::DeviceType::Button); | 297 | }, |
| 298 | InputCommon::Polling::DeviceType::Button); | ||
| 283 | }); | 299 | }); |
| 284 | connect(analog_button, &QPushButton::customContextMenuRequested, | 300 | connect(analog_button, &QPushButton::customContextMenuRequested, |
| 285 | [=](const QPoint& menu_location) { | 301 | [=](const QPoint& menu_location) { |