summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Narr the Reg2022-09-05 16:08:30 -0500
committerGravatar Narr the Reg2022-09-05 16:09:21 -0500
commitdc8d42243b1eb4ea2b1192273e58586a617419be (patch)
treee4f4323bb4f80ad85b96b5f64846798ecce32610
parentMerge pull request #8843 from Kelebek1/SILENCE_WENCH (diff)
downloadyuzu-dc8d42243b1eb4ea2b1192273e58586a617419be.tar.gz
yuzu-dc8d42243b1eb4ea2b1192273e58586a617419be.tar.xz
yuzu-dc8d42243b1eb4ea2b1192273e58586a617419be.zip
core: hid: Fix GC triggers overwritting ZL and ZR buttons
Diffstat (limited to '')
-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
562 return; 562 return;
563 } 563 }
564 564
565 // GC controllers have triggers not buttons
566 if (npad_type == NpadStyleIndex::GameCube) {
567 if (index == Settings::NativeButton::ZR) {
568 return;
569 }
570 if (index == Settings::NativeButton::ZL) {
571 return;
572 }
573 }
574
565 switch (index) { 575 switch (index) {
566 case Settings::NativeButton::A: 576 case Settings::NativeButton::A:
567 controller.npad_button_state.a.Assign(current_status.value); 577 controller.npad_button_state.a.Assign(current_status.value);
@@ -738,6 +748,11 @@ void EmulatedController::SetTrigger(const Common::Input::CallbackStatus& callbac
738 return; 748 return;
739 } 749 }
740 750
751 // Only GC controllers have analog triggers
752 if (npad_type != NpadStyleIndex::GameCube) {
753 return;
754 }
755
741 const auto& trigger = controller.trigger_values[index]; 756 const auto& trigger = controller.trigger_values[index];
742 757
743 switch (index) { 758 switch (index) {