summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-10-14 19:04:49 +0200
committerGitHub <noreply@github.com>2019-10-14 19:04:49 +0200
commitc274fd588dfcb3c9068e00e260e85aaa72ed4216 (patch)
tree28f6efaf4f6e4639812e1537d37e6d5f7d2d40da /src
parentMerge pull request #2930 from DarkLordZach/gamecard-partitions (diff)
parentfixed clang format & addressed feedback (diff)
downloadyuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar.gz
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar.bz2
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar.lz
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar.xz
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.tar.zst
yuzu-c274fd588dfcb3c9068e00e260e85aaa72ed4216.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_input_player.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp
index a968cfb5d..67c9a7c6d 100644
--- a/src/yuzu/configuration/configure_input_player.cpp
+++ b/src/yuzu/configuration/configure_input_player.cpp
@@ -245,10 +245,24 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(button, &QPushButton::clicked, [=] {
- HandleClick(
- button_map[button_id],
- [=](const Common::ParamPackage& params) { buttons_param[button_id] = params; },
- InputCommon::Polling::DeviceType::Button);
+ HandleClick(button_map[button_id],
+ [=](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, [=](const QPoint& menu_location) {
QMenu context_menu;