From b94e947793dcb53e9e00ef8bf587b2f689d38d41 Mon Sep 17 00:00:00 2001 From: german77 Date: Sat, 25 Dec 2021 19:00:11 -0600 Subject: core/hid: Add home and screenshot button support --- src/core/hid/emulated_controller.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/core/hid/emulated_controller.h') diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index c0994ab4d..bee16a8ed 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -101,6 +101,8 @@ struct ControllerStatus { VibrationValues vibration_values{}; // Data for HID serices + HomeButtonState home_button_state{}; + CaptureButtonState capture_button_state{}; NpadButtonState npad_button_state{}; DebugPadButton debug_pad_button_state{}; AnalogSticks analog_stick_state{}; @@ -261,7 +263,13 @@ public: /// Returns the latest battery status from the controller with parameters BatteryValues GetBatteryValues() const; - /// Returns the latest status of button input for the npad service + /// Returns the latest status of button input for the hid::HomeButton service + HomeButtonState GetHomeButtons() const; + + /// Returns the latest status of button input for the hid::CaptureButton service + CaptureButtonState GetCaptureButtons() const; + + /// Returns the latest status of button input for the hid::Npad service NpadButtonState GetNpadButtons() const; /// Returns the latest status of button input for the debug pad service -- cgit v1.2.3 From 72c8a94a6cdb4d3f322fa6d4b06eab824f53dba6 Mon Sep 17 00:00:00 2001 From: german77 Date: Mon, 15 Nov 2021 17:57:41 -0600 Subject: yuzu: Add controller hotkeys --- src/core/hid/emulated_controller.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/hid/emulated_controller.h') diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h index bee16a8ed..a63a83cce 100644 --- a/src/core/hid/emulated_controller.h +++ b/src/core/hid/emulated_controller.h @@ -200,6 +200,15 @@ public: /// Returns the emulated controller into normal mode, allowing the modification of the HID state void DisableConfiguration(); + /// Enables Home and Screenshot buttons + void EnableSystemButtons(); + + /// Disables Home and Screenshot buttons + void DisableSystemButtons(); + + /// Sets Home and Screenshot buttons to false + void ResetSystemButtons(); + /// Returns true if the emulated controller is in configuring mode bool IsConfiguring() const; @@ -391,6 +400,7 @@ private: NpadStyleTag supported_style_tag{NpadStyleSet::All}; bool is_connected{false}; bool is_configuring{false}; + bool system_buttons_enabled{true}; f32 motion_sensitivity{0.01f}; bool force_update_motion{false}; -- cgit v1.2.3