Added hidGetHandheldMode().

This commit is contained in:
yellows8 2018-03-15 22:24:52 -04:00
parent 0d5bf5ab7b
commit 213676c5f8
2 changed files with 8 additions and 0 deletions

View File

@ -581,6 +581,10 @@ void hidTouchRead(touchPosition *pos, u32 point_id);
void hidJoystickRead(JoystickPosition *pos, HidControllerID id, HidControllerJoystick stick);
/// This can be used to check what CONTROLLER_P1_AUTO uses.
/// Returns 0 when CONTROLLER_PLAYER_1 is connected, otherwise returns 1 for handheld-mode.
bool hidGetHandheldMode(void);
/// Use this if you want to use a single joy-con as a dedicated CONTROLLER_PLAYER_*.
/// When used, both joy-cons in a pair should be used with this (CONTROLLER_PLAYER_1 and CONTROLLER_PLAYER_2 for example).
/// id must be CONTROLLER_PLAYER_*.

View File

@ -370,6 +370,10 @@ void hidJoystickRead(JoystickPosition *pos, HidControllerID id, HidControllerJoy
}
}
bool hidGetHandheldMode(void) {
return g_controllerP1AutoID == CONTROLLER_HANDHELD;
}
static Result _hidSetDualModeAll(void) {
Result rc;
int i;