diff options
| author | bunnei <bunneidev@gmail.com> | 2022-09-09 21:53:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-09 21:53:53 -0700 |
| commit | 44ce3eaf4cf64ca6274f793fd90098911994b126 (patch) | |
| tree | e9adadbf420f68f4325542d1c1e2a90bf4fdfcd0 /src/core/hid/emulated_controller.cpp | |
| parent | 7dc3d491350d76f2103e70f01d58721046699ded (diff) | |
| parent | 07d2e0827219b3c844363fe21e32a56e0ec00df7 (diff) | |
Merge pull request #8863 from german77/triggers
core: hid: Fix GC triggers overwriting ZL and ZR buttons
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index f9f902c2dd..01c43be934 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) { |
