From d24f1ca61195b19c8a850b53a711c3b7c64758e6 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Wed, 13 Nov 2019 20:53:40 -0500 Subject: [PATCH] Added appletSetInputDetectionPolicy and AppletInputDetectionPolicy. --- nx/include/switch/services/applet.h | 13 +++++++++++++ nx/source/services/applet.c | 1 + 2 files changed, 14 insertions(+) diff --git a/nx/include/switch/services/applet.h b/nx/include/switch/services/applet.h index d9d784fe..5c082e1b 100644 --- a/nx/include/switch/services/applet.h +++ b/nx/include/switch/services/applet.h @@ -178,6 +178,12 @@ typedef enum { AppletIdleTimeDetectionExtension_ExtendedUnsafe = 2, ///< ExtendedUnsafe } AppletIdleTimeDetectionExtension; +/// Input policy values for \ref appletSetInputDetectionPolicy. +typedef enum { + AppletInputDetectionPolicy_Unknown0 = 0, ///< Unknown. + AppletInputDetectionPolicy_Unknown1 = 1, ///< Unknown. +} AppletInputDetectionPolicy; + /// Input mode values for \ref appletSetWirelessPriorityMode. typedef enum { AppletWirelessPriorityMode_Unknown1 = 1, ///< Unknown. @@ -742,6 +748,13 @@ Result appletIsAutoSleepDisabled(bool *out); */ Result appletGetCurrentIlluminanceEx(bool *bOverLimit, float *fLux); +/** + * @brief Sets the \ref AppletInputDetectionPolicy. + * @note Only available with [9.0.0+]. + * @param[in] policy \ref AppletInputDetectionPolicy + */ +Result appletSetInputDetectionPolicy(AppletInputDetectionPolicy policy); + /** * @brief Sets the WirelessPriorityMode. * @note Only available with [4.0.0+]. diff --git a/nx/source/services/applet.c b/nx/source/services/applet.c index b171656c..c4c91ae4 100644 --- a/nx/source/services/applet.c +++ b/nx/source/services/applet.c @@ -1089,6 +1089,7 @@ Result appletGetCurrentIlluminanceEx(bool *bOverLimit, float *fLux) { return rc; } +IPC_MAKE_CMD_IMPL_HOSVER( Result appletSetInputDetectionPolicy(AppletInputDetectionPolicy policy), &g_appletISelfController, 72, _appletCmdInU32NoOut, (9,0,0), policy) IPC_MAKE_CMD_IMPL_HOSVER( Result appletSetWirelessPriorityMode(AppletWirelessPriorityMode mode), &g_appletISelfController, 80, _appletCmdInU32NoOut, (4,0,0), mode) IPC_MAKE_CMD_IMPL_HOSVER(static Result _appletGetAccumulatedSuspendedTickValue(u64 *tick), &g_appletISelfController, 90, _appletCmdNoInOutU64, (6,0,0), tick) IPC_MAKE_CMD_IMPL_HOSVER(static Result _appletGetAccumulatedSuspendedTickChangedEvent(Event *out_event), &g_appletISelfController, 91, _appletCmdGetEvent, (6,0,0), out_event, true)