aboutsummaryrefslogtreecommitdiff
path: root/src/hid_core/resources/applet_resource.cpp
diff options
context:
space:
mode:
authorNarr the Reg <juangerman-13@hotmail.com>2024-01-10 22:06:54 -0600
committergerman77 <juangerman-13@hotmail.com>2024-01-15 23:15:40 -0600
commite2313faec9c395e1041c6e1916b68143305b2b56 (patch)
tree12badf5b4eede22b22dece03a9074197ec631a1e /src/hid_core/resources/applet_resource.cpp
parentfa21d6ee850e199079a1f5fbbf1a02824515f6e6 (diff)
service: hid: Fully implement abstract vibration
Diffstat (limited to 'src/hid_core/resources/applet_resource.cpp')
-rw-r--r--src/hid_core/resources/applet_resource.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/hid_core/resources/applet_resource.cpp b/src/hid_core/resources/applet_resource.cpp
index a84826050a..db4134037d 100644
--- a/src/hid_core/resources/applet_resource.cpp
+++ b/src/hid_core/resources/applet_resource.cpp
@@ -200,6 +200,25 @@ void AppletResource::EnableInput(u64 aruid, bool is_enabled) {
data[index].flag.enable_touchscreen.Assign(is_enabled);
}
+bool AppletResource::SetAruidValidForVibration(u64 aruid, bool is_enabled) {
+ const u64 index = GetIndexFromAruid(aruid);
+ if (index >= AruidIndexMax) {
+ return false;
+ }
+
+ if (!is_enabled && aruid == active_vibration_aruid) {
+ active_vibration_aruid = SystemAruid;
+ return true;
+ }
+
+ if (is_enabled && aruid != active_vibration_aruid) {
+ active_vibration_aruid = aruid;
+ return true;
+ }
+
+ return false;
+}
+
void AppletResource::EnableSixAxisSensor(u64 aruid, bool is_enabled) {
const u64 index = GetIndexFromAruid(aruid);
if (index >= AruidIndexMax) {