aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hle/service/am/button_poller.h
diff options
context:
space:
mode:
authoryuzubot <[email protected]>2024-03-04 13:02:54 +0000
committeryuzubot <[email protected]>2024-03-04 13:02:54 +0000
commit537296095ab24eddcb196b5ef98004f91de9c8c2 (patch)
treee75e9e2441dc3f8657cc42f2daaae08737949c2b /src/core/hle/service/am/button_poller.h
parent2ddac7b02b660bbc7bdfe4fef240699df6d52e64 (diff)
downloadyuzu-mainline-master.tar.gz
yuzu-mainline-master.zip
"Merge Tagged PR 13018"HEADmaster
Diffstat (limited to 'src/core/hle/service/am/button_poller.h')
-rw-r--r--src/core/hle/service/am/button_poller.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/core/hle/service/am/button_poller.h b/src/core/hle/service/am/button_poller.h
new file mode 100644
index 000000000..b1c39aad3
--- /dev/null
+++ b/src/core/hle/service/am/button_poller.h
@@ -0,0 +1,43 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <chrono>
+#include <optional>
+#include "hid_core/frontend/emulated_controller.h"
+
+namespace Core {
+namespace HID {
+class EmulatedController;
+}
+
+class System;
+} // namespace Core
+
+namespace Service::AM {
+
+class WindowSystem;
+
+class ButtonPoller {
+public:
+ explicit ButtonPoller(Core::System& system, WindowSystem& window_system);
+ ~ButtonPoller();
+
+private:
+ void OnButtonStateChanged();
+
+private:
+ WindowSystem& m_window_system;
+
+ Core::HID::EmulatedController* m_handheld{};
+ int m_handheld_key{};
+ Core::HID::EmulatedController* m_player1{};
+ int m_player1_key{};
+
+ std::optional<std::chrono::steady_clock::time_point> m_home_button_press_start{};
+ std::optional<std::chrono::steady_clock::time_point> m_capture_button_press_start{};
+ std::optional<std::chrono::steady_clock::time_point> m_power_button_press_start{};
+};
+
+} // namespace Service::AM