aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/hid_core
diff options
context:
space:
mode:
authorgerman77 <[email protected]>2024-01-06 21:35:10 -0600
committerNarr the Reg <[email protected]>2024-01-06 23:30:41 -0600
commitf224ef6185679338aa8eb8093b150c461f488982 (patch)
tree153d010b4d9a46f4a57e7cfec09f8fd419c17af8 /src/hid_core
parenta36f4d0a9f2c0fee837856e4db3e4ca10bfed25b (diff)
downloadyuzu-android-f224ef6185679338aa8eb8093b150c461f488982.tar.gz
yuzu-android-f224ef6185679338aa8eb8093b150c461f488982.zip
service: hid: Implement SetNpadSystemExtStateEnabled
Diffstat (limited to 'src/hid_core')
-rw-r--r--src/hid_core/resources/npad/npad.cpp12
-rw-r--r--src/hid_core/resources/npad/npad.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp
index ea035d759..6be6edb7e 100644
--- a/src/hid_core/resources/npad/npad.cpp
+++ b/src/hid_core/resources/npad/npad.cpp
@@ -1356,4 +1356,16 @@ std::size_t NPad::GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton
return npad_resource.GetNpadCaptureButtonAssignment(out_list, aruid);
}
+Result NPad::SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled) {
+ std::scoped_lock lock{mutex};
+ const auto result = npad_resource.SetNpadSystemExtStateEnabled(aruid, is_enabled);
+
+ if (result.IsSuccess()) {
+ std::scoped_lock shared_lock{*applet_resource_holder.shared_mutex};
+ // TODO: abstracted_pad->EnableAppletToGetInput(aruid);
+ }
+
+ return result;
+}
+
} // namespace Service::HID
diff --git a/src/hid_core/resources/npad/npad.h b/src/hid_core/resources/npad/npad.h
index e602ddaea..73e2780c4 100644
--- a/src/hid_core/resources/npad/npad.h
+++ b/src/hid_core/resources/npad/npad.h
@@ -155,6 +155,8 @@ public:
std::size_t GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
u64 aruid) const;
+ Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled);
+
private:
struct VibrationData {
bool device_mounted{};