hidsys: add commands for setting/checking state of joycons attached via rails

This commit is contained in:
ndeadly 2025-01-15 16:40:02 +01:00 committed by fincs
parent 88de3cbea7
commit 29a6691b66
2 changed files with 88 additions and 0 deletions

View File

@ -323,6 +323,51 @@ Result hidsysGetUniquePadsFromNpad(HidNpadIdType id, HidsysUniquePadId *unique_p
**/
Result hidsysEnableAppletToGetInput(bool enable);
/**
* @brief EnableHandheldHids
**/
Result hidsysEnableHandheldHids(void);
/**
* @brief DisableHandheldHids
**/
Result hidsysDisableHandheldHids(void);
/**
* @brief SetJoyConRailEnabled
* @note Only available on [9.0.0+].
* @param[in] enable Input flag.
**/
Result hidsysSetJoyConRailEnabled(bool enable);
/**
* @brief IsJoyConRailEnabled
* @note Only available on [9.0.0+].
* @param[out] out Output flag.
**/
Result hidsysIsJoyConRailEnabled(bool *out);
/**
* @brief IsHandheldHidsEnabled
* @note Only available on [10.0.0+].
* @param[out] out Output flag.
**/
Result hidsysIsHandheldHidsEnabled(bool *out);
/**
* @brief IsJoyConAttachedOnAllRail
* @note Only available on [11.0.0+].
* @param[out] out Output flag.
**/
Result hidsysIsJoyConAttachedOnAllRail(bool *out);
/**
* @brief IsInvertedControllerConnectedOnRail
* @note Only available on [19.0.0+].
* @param[out] out Output flag.
**/
Result hidsysIsInvertedControllerConnectedOnRail(bool *out);
/**
* @brief AcquireUniquePadConnectionEventHandle
* @param[out] out_event Output Event.

View File

@ -340,6 +340,49 @@ Result hidsysEnableAppletToGetInput(bool enable) {
return serviceDispatchIn(&g_hidsysSrv, 503, in);
}
Result hidsysEnableHandheldHids(void) {
return _hidsysCmdNoIO(520);
}
Result hidsysDisableHandheldHids(void) {
return _hidsysCmdNoIO(521);
}
Result hidsysSetJoyConRailEnabled(bool enable) {
if (hosversionBefore(9,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _hidsysCmdInBoolNoOut(enable, 522);
}
Result hidsysIsJoyConRailEnabled(bool *out) {
if (hosversionBefore(9,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _hidsysCmdNoInOutBool(out, 523);
}
Result hidsysIsHandheldHidsEnabled(bool *out) {
if (hosversionBefore(10,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _hidsysCmdNoInOutBool(out, 524);
}
Result hidsysIsJoyConAttachedOnAllRail(bool *out) {
if (hosversionBefore(11,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _hidsysCmdNoInOutBool(out, 525);
}
Result hidsysIsInvertedControllerConnectedOnRail(bool *out) {
if (hosversionBefore(19,0,0))
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _hidsysCmdNoInOutBool(out, 526);
}
Result hidsysAcquireUniquePadConnectionEventHandle(Event *out_event) {
Handle tmp_handle = INVALID_HANDLE;