diff options
| author | liamwhite <liamwhite@users.noreply.github.com> | 2024-01-20 13:34:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-20 13:34:54 -0500 |
| commit | 48d9e11d9d88e8dc82e87bf84292ce69185fe300 (patch) | |
| tree | 3c3530e2f955545968fcc605122aa7565f4b5f1a /src/hid_core/resources/applet_resource.cpp | |
| parent | cd923785ba864b062e85765ba3a5f19628baf770 (diff) | |
| parent | e2313faec9c395e1041c6e1916b68143305b2b56 (diff) | |
Merge pull request #12660 from german77/better-vibration
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.cpp | 19 |
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) { |
