summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar FreddyFunk2019-10-10 23:27:00 +0200
committerGravatar FreddyFunk2019-10-10 23:27:00 +0200
commitbe5dc68ca3ee9e28e421b81001ac270aaadd9f1f (patch)
tree19f48bfaafcb31cf22c447bc89bf64e7408f4996
parentyuzu/configure_input_player: Fix input handling for ZL and ZR from controller... (diff)
downloadyuzu-be5dc68ca3ee9e28e421b81001ac270aaadd9f1f.tar.gz
yuzu-be5dc68ca3ee9e28e421b81001ac270aaadd9f1f.tar.xz
yuzu-be5dc68ca3ee9e28e421b81001ac270aaadd9f1f.zip
fixed clang format & addressed feedback
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp50
1 files changed, 24 insertions, 26 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index bfb14bb43..67c9a7c6d 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -245,25 +245,24 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
245 245
246 button->setContextMenuPolicy(Qt::CustomContextMenu); 246 button->setContextMenuPolicy(Qt::CustomContextMenu);
247 connect(button, &QPushButton::clicked, [=] { 247 connect(button, &QPushButton::clicked, [=] {
248 HandleClick( 248 HandleClick(button_map[button_id],
249 button_map[button_id], 249 [=](Common::ParamPackage params) {
250 [=](Common::ParamPackage params) { 250 // Workaround for ZL & ZR for analog triggers like on XBOX controllors.
251 // Workaround for ZL & ZR for analog triggers like on XBOX controllors. 251 // Analog triggers (from controllers like the XBOX controller) would not
252 // Analog triggers (from controllers like the XBOX controller) would not work 252 // work due to a different range of their signals (from 0 to 255 on
253 // due to a different range of their signals (from 0 to 255 on analog triggers 253 // analog triggers instead of -32768 to 32768 on analog joysticks). The
254 // instead of -32768 to 32768 on analog joysticks). The SDL driver misinterprets 254 // SDL driver misinterprets analog triggers as analog joysticks.
255 // analog triggers as analog joysticks. 255 // TODO: reinterpret the signal range for analog triggers to map the
256 // TODO: reinterpret the signal range for analog triggers to map the values 256 // values correctly. This is required for the correct emulation of the
257 // correctly. This is required for the correct emulation of the analog triggers 257 // analog triggers of the GameCube controller.
258 // of the GameCube controller. 258 if (button_id == Settings::NativeButton::ZL ||
259 if (button_id == Settings::NativeButton::ZL || 259 button_id == Settings::NativeButton::ZR) {
260 button_id == Settings::NativeButton::ZR) { 260 params.Set("direction", "+");
261 params.Set("direction", "+"); 261 params.Set("threshold", "0.5");
262 params.Set("threshold", "0.5"); 262 }
263 } 263 buttons_param[button_id] = std::move(params);
264 buttons_param[button_id] = params; 264 },
265 }, 265 InputCommon::Polling::DeviceType::Button);
266 InputCommon::Polling::DeviceType::Button);
267 }); 266 });
268 connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { 267 connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) {
269 QMenu context_menu; 268 QMenu context_menu;
@@ -289,13 +288,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
289 288
290 analog_button->setContextMenuPolicy(Qt::CustomContextMenu); 289 analog_button->setContextMenuPolicy(Qt::CustomContextMenu);
291 connect(analog_button, &QPushButton::clicked, [=]() { 290 connect(analog_button, &QPushButton::clicked, [=]() {
292 HandleClick( 291 HandleClick(analog_map_buttons[analog_id][sub_button_id],
293 analog_map_buttons[analog_id][sub_button_id], 292 [=](const Common::ParamPackage& params) {
294 [=](const Common::ParamPackage& params) { 293 SetAnalogButton(params, analogs_param[analog_id],
295 SetAnalogButton(params, analogs_param[analog_id], 294 analog_sub_buttons[sub_button_id]);
296 analog_sub_buttons[sub_button_id]); 295 },
297 }, 296 InputCommon::Polling::DeviceType::Button);
298 InputCommon::Polling::DeviceType::Button);
299 }); 297 });
300 connect(analog_button, &QPushButton::customContextMenuRequested, 298 connect(analog_button, &QPushButton::customContextMenuRequested,
301 [=](const QPoint& menu_location) { 299 [=](const QPoint& menu_location) {