summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/applet_resource.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-20 19:34:54 +0100
committerGitHub <noreply@github.com>2024-01-20 19:34:54 +0100
commit5838779162897606a3525eb619379a56b2eec027 (patch)
tree3c3530e2f955545968fcc605122aa7565f4b5f1a /src/hid_core/resources/applet_resource.cpp
parentMerge pull request #12701 from liamwhite/flinger-layer-issues (diff)
parentservice: hid: Fully implement abstract vibration (diff)
downloadyuzu-5838779162897606a3525eb619379a56b2eec027.tar
yuzu-5838779162897606a3525eb619379a56b2eec027.tar.gz
yuzu-5838779162897606a3525eb619379a56b2eec027.tar.bz2
yuzu-5838779162897606a3525eb619379a56b2eec027.tar.lz
yuzu-5838779162897606a3525eb619379a56b2eec027.tar.xz
yuzu-5838779162897606a3525eb619379a56b2eec027.tar.zst
yuzu-5838779162897606a3525eb619379a56b2eec027.zip
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 a84826050..db4134037 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) {