From b94e947793dcb53e9e00ef8bf587b2f689d38d41 Mon Sep 17 00:00:00 2001
From: german77 <juangerman-13@hotmail.com>
Date: Sat, 25 Dec 2021 19:00:11 -0600
Subject: core/hid: Add home and screenshot button support

---
 src/core/hid/emulated_controller.cpp | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'src/core/hid/emulated_controller.cpp')

diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 71fc058074..9f68a41ccc 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
             controller.npad_button_state.right_sr.Assign(current_status.value);
             break;
         case Settings::NativeButton::Home:
+            controller.home_button_state.home.Assign(current_status.value);
+            break;
         case Settings::NativeButton::Screenshot:
+            controller.capture_button_state.capture.Assign(current_status.value);
             break;
         }
     }
@@ -1077,6 +1080,20 @@ BatteryValues EmulatedController::GetBatteryValues() const {
     return controller.battery_values;
 }
 
+HomeButtonState EmulatedController::GetHomeButtons() const {
+    if (is_configuring) {
+        return {};
+    }
+    return controller.home_button_state;
+}
+
+CaptureButtonState EmulatedController::GetCaptureButtons() const {
+    if (is_configuring) {
+        return {};
+    }
+    return controller.capture_button_state;
+}
+
 NpadButtonState EmulatedController::GetNpadButtons() const {
     if (is_configuring) {
         return {};
-- 
cgit v1.2.3-70-g09d2