From c8cd8f9f70fd898ad0c22f6a5fe90b155478e977 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 4 May 2026 16:42:31 +0200 Subject: [PATCH 1/4] Add hidsysSetAppletResourceUserId() --- nx/source/services/hidsys.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nx/source/services/hidsys.c b/nx/source/services/hidsys.c index 14cd72a4a9..7304222fd0 100644 --- a/nx/source/services/hidsys.c +++ b/nx/source/services/hidsys.c @@ -331,6 +331,10 @@ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_p return rc; } +Result hidsysSetAppletResourceUserId() { + return serviceDispatchIn(&g_hidsysSrv, 500, g_hidsysAppletResourceUserId); +} + Result hidsysEnableAppletToGetInput(bool enable) { const struct { u8 permitInput; From cc92d07524878a995108024a11329cec1a25d86b Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 4 May 2026 16:52:05 +0200 Subject: [PATCH 2/4] Add hidsysSetAppletResourceUserId() --- nx/include/switch/services/hidsys.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nx/include/switch/services/hidsys.h b/nx/include/switch/services/hidsys.h index 033829f10f..b4329423f7 100644 --- a/nx/include/switch/services/hidsys.h +++ b/nx/include/switch/services/hidsys.h @@ -317,6 +317,13 @@ Result hidsysHasLeftRightBattery(HidNpadIdType id, bool *out0, bool *out1); */ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_pad_ids, s32 count, s32 *total_out); +/** + * @brief Sets information that your AppletResourceUserId is in focus. + * @note This is automatically used by am-sysmodule, don't use it if your AppletType is other than None. + * @note Using it with uninitialized applet services results in your process being tied to currently focused applet. + */ +Result hidsysSetAppletResourceUserId(); + /** * @brief EnableAppletToGetInput * @param[in] enable Input flag. From c0b89043c9b6aa2fde2162a487e122fdb5775772 Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 4 May 2026 17:21:20 +0200 Subject: [PATCH 3/4] Fix function declaration --- nx/include/switch/services/hidsys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/include/switch/services/hidsys.h b/nx/include/switch/services/hidsys.h index b4329423f7..e6b186c70d 100644 --- a/nx/include/switch/services/hidsys.h +++ b/nx/include/switch/services/hidsys.h @@ -322,7 +322,7 @@ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_p * @note This is automatically used by am-sysmodule, don't use it if your AppletType is other than None. * @note Using it with uninitialized applet services results in your process being tied to currently focused applet. */ -Result hidsysSetAppletResourceUserId(); +Result hidsysSetAppletResourceUserId(void); /** * @brief EnableAppletToGetInput From c4d0a4ced042c7ef74d85de332740c45ffd2919b Mon Sep 17 00:00:00 2001 From: MasaGratoR Date: Mon, 4 May 2026 17:50:35 +0200 Subject: [PATCH 4/4] Fix function declaration --- nx/source/services/hidsys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx/source/services/hidsys.c b/nx/source/services/hidsys.c index 7304222fd0..682c6c7e58 100644 --- a/nx/source/services/hidsys.c +++ b/nx/source/services/hidsys.c @@ -331,7 +331,7 @@ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_p return rc; } -Result hidsysSetAppletResourceUserId() { +Result hidsysSetAppletResourceUserId(void) { return serviceDispatchIn(&g_hidsysSrv, 500, g_hidsysAppletResourceUserId); }