summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-09-10 06:53:53 +0200
committerGitHub <noreply@github.com>2022-09-10 06:53:53 +0200
commit16080b6e4e28b49e0e320879ebbab34199fb81c2 (patch)
treee9adadbf420f68f4325542d1c1e2a90bf4fdfcd0 /src
parentMerge pull request #8864 from german77/toggle_analog (diff)
parentcore: hid: Fix GC triggers overwritting ZL and ZR buttons (diff)
downloadyuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar.gz
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar.bz2
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar.lz
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar.xz
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.tar.zst
yuzu-16080b6e4e28b49e0e320879ebbab34199fb81c2.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hid/emulated_controller.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index f9f902c2d..01c43be93 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -562,6 +562,16 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback
return;
}
+ // GC controllers have triggers not buttons
+ if (npad_type == NpadStyleIndex::GameCube) {
+ if (index == Settings::NativeButton::ZR) {
+ return;
+ }
+ if (index == Settings::NativeButton::ZL) {
+ return;
+ }
+ }
+
switch (index) {
case Settings::NativeButton::A:
controller.npad_button_state.a.Assign(current_status.value);
@@ -738,6 +748,11 @@ void EmulatedController::SetTrigger(const Common::Input::CallbackStatus& callbac
return;
}
+ // Only GC controllers have analog triggers
+ if (npad_type != NpadStyleIndex::GameCube) {
+ return;
+ }
+
const auto& trigger = controller.trigger_values[index];
switch (index) {