diff options
| author | 2022-09-20 11:56:43 +0800 | |
|---|---|---|
| committer | 2022-09-20 11:56:43 +0800 | |
| commit | c864cb57726e76e9dc4558036f3212168bec825d (patch) | |
| tree | ca79c4397f40990488a7b5691e15c0fcfec507b6 /src/core/hid | |
| parent | video_core: Generate mipmap texture by drawing (diff) | |
| parent | Merge pull request #8849 from Morph1984/parallel-astc (diff) | |
| download | yuzu-c864cb57726e76e9dc4558036f3212168bec825d.tar.gz yuzu-c864cb57726e76e9dc4558036f3212168bec825d.tar.xz yuzu-c864cb57726e76e9dc4558036f3212168bec825d.zip | |
Merge branch 'master' into mipmap
Diffstat (limited to 'src/core/hid')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 15 | ||||
| -rw-r--r-- | src/core/hid/input_converter.cpp | 3 |
2 files changed, 18 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) { |
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp index 68d143a01..52fb69e9c 100644 --- a/src/core/hid/input_converter.cpp +++ b/src/core/hid/input_converter.cpp | |||
| @@ -52,6 +52,9 @@ Common::Input::ButtonStatus TransformToButton(const Common::Input::CallbackStatu | |||
| 52 | Common::Input::ButtonStatus status{}; | 52 | Common::Input::ButtonStatus status{}; |
| 53 | switch (callback.type) { | 53 | switch (callback.type) { |
| 54 | case Common::Input::InputType::Analog: | 54 | case Common::Input::InputType::Analog: |
| 55 | status.value = TransformToTrigger(callback).pressed.value; | ||
| 56 | status.toggle = callback.analog_status.properties.toggle; | ||
| 57 | break; | ||
| 55 | case Common::Input::InputType::Trigger: | 58 | case Common::Input::InputType::Trigger: |
| 56 | status.value = TransformToTrigger(callback).pressed.value; | 59 | status.value = TransformToTrigger(callback).pressed.value; |
| 57 | break; | 60 | break; |