diff --git a/nx/include/switch/services/hidsys.h b/nx/include/switch/services/hidsys.h index 033829f10..e6b186c70 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(void); + /** * @brief EnableAppletToGetInput * @param[in] enable Input flag. diff --git a/nx/source/services/hidsys.c b/nx/source/services/hidsys.c index 14cd72a4a..682c6c7e5 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(void) { + return serviceDispatchIn(&g_hidsysSrv, 500, g_hidsysAppletResourceUserId); +} + Result hidsysEnableAppletToGetInput(bool enable) { const struct { u8 permitInput;