diff options
| author | 2021-12-25 19:00:11 -0600 | |
|---|---|---|
| committer | 2022-01-06 21:11:27 -0600 | |
| commit | b94e947793dcb53e9e00ef8bf587b2f689d38d41 (patch) | |
| tree | f711fb7056365911b83dd859ddb5a2971af1924c /src/core/hid/emulated_controller.cpp | |
| parent | Merge pull request #7673 from german77/no_return (diff) | |
| download | yuzu-b94e947793dcb53e9e00ef8bf587b2f689d38d41.tar.gz yuzu-b94e947793dcb53e9e00ef8bf587b2f689d38d41.tar.xz yuzu-b94e947793dcb53e9e00ef8bf587b2f689d38d41.zip | |
core/hid: Add home and screenshot button support
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 71fc05807..9f68a41cc 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -596,7 +596,10 @@ void EmulatedController::SetButton(const Common::Input::CallbackStatus& callback | |||
| 596 | controller.npad_button_state.right_sr.Assign(current_status.value); | 596 | controller.npad_button_state.right_sr.Assign(current_status.value); |
| 597 | break; | 597 | break; |
| 598 | case Settings::NativeButton::Home: | 598 | case Settings::NativeButton::Home: |
| 599 | controller.home_button_state.home.Assign(current_status.value); | ||
| 600 | break; | ||
| 599 | case Settings::NativeButton::Screenshot: | 601 | case Settings::NativeButton::Screenshot: |
| 602 | controller.capture_button_state.capture.Assign(current_status.value); | ||
| 600 | break; | 603 | break; |
| 601 | } | 604 | } |
| 602 | } | 605 | } |
| @@ -1077,6 +1080,20 @@ BatteryValues EmulatedController::GetBatteryValues() const { | |||
| 1077 | return controller.battery_values; | 1080 | return controller.battery_values; |
| 1078 | } | 1081 | } |
| 1079 | 1082 | ||
| 1083 | HomeButtonState EmulatedController::GetHomeButtons() const { | ||
| 1084 | if (is_configuring) { | ||
| 1085 | return {}; | ||
| 1086 | } | ||
| 1087 | return controller.home_button_state; | ||
| 1088 | } | ||
| 1089 | |||
| 1090 | CaptureButtonState EmulatedController::GetCaptureButtons() const { | ||
| 1091 | if (is_configuring) { | ||
| 1092 | return {}; | ||
| 1093 | } | ||
| 1094 | return controller.capture_button_state; | ||
| 1095 | } | ||
| 1096 | |||
| 1080 | NpadButtonState EmulatedController::GetNpadButtons() const { | 1097 | NpadButtonState EmulatedController::GetNpadButtons() const { |
| 1081 | if (is_configuring) { | 1098 | if (is_configuring) { |
| 1082 | return {}; | 1099 | return {}; |