summaryrefslogtreecommitdiff
path: root/src/hid_core/resources
diff options
context:
space:
mode:
authorGravatar german772024-01-06 21:54:23 -0600
committerGravatar Narr the Reg2024-01-06 23:30:42 -0600
commit3516a2d0bff5a7d6a22ff1b4fb7cbc021c6b4d1e (patch)
tree62a10dcbdeef6bab4c8776e1c0d570e377f2c19c /src/hid_core/resources
parentservice: hid: Implement SetNpadSystemExtStateEnabled (diff)
downloadyuzu-3516a2d0bff5a7d6a22ff1b4fb7cbc021c6b4d1e.tar.gz
yuzu-3516a2d0bff5a7d6a22ff1b4fb7cbc021c6b4d1e.tar.xz
yuzu-3516a2d0bff5a7d6a22ff1b4fb7cbc021c6b4d1e.zip
service: hid: Implement AssigningSingleOnSlSrPress
Diffstat (limited to 'src/hid_core/resources')
-rw-r--r--src/hid_core/resources/npad/npad.cpp10
-rw-r--r--src/hid_core/resources/npad/npad.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/hid_core/resources/npad/npad.cpp b/src/hid_core/resources/npad/npad.cpp
index 6be6edb7e..2995634c5 100644
--- a/src/hid_core/resources/npad/npad.cpp
+++ b/src/hid_core/resources/npad/npad.cpp
@@ -1368,4 +1368,14 @@ Result NPad::SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled) {
1368 return result; 1368 return result;
1369} 1369}
1370 1370
1371Result NPad::AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled) {
1372 std::scoped_lock lock{mutex};
1373 bool is_currently_enabled{};
1374 Result result = npad_resource.IsAssigningSingleOnSlSrPressEnabled(is_currently_enabled, aruid);
1375 if (result.IsSuccess() && is_enabled != is_currently_enabled) {
1376 result = npad_resource.SetAssigningSingleOnSlSrPress(aruid, is_enabled);
1377 }
1378 return result;
1379}
1380
1371} // namespace Service::HID 1381} // namespace Service::HID
diff --git a/src/hid_core/resources/npad/npad.h b/src/hid_core/resources/npad/npad.h
index 73e2780c4..91bc59afd 100644
--- a/src/hid_core/resources/npad/npad.h
+++ b/src/hid_core/resources/npad/npad.h
@@ -157,6 +157,8 @@ public:
157 157
158 Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled); 158 Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled);
159 159
160 Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
161
160private: 162private:
161 struct VibrationData { 163 struct VibrationData {
162 bool device_mounted{}; 164 bool device_mounted{};