diff --git a/nx/source/services/hid.c b/nx/source/services/hid.c index 46cd40fe..8c568537 100644 --- a/nx/source/services/hid.c +++ b/nx/source/services/hid.c @@ -206,7 +206,23 @@ void hidScanInput(void) { u32 style_set = hidGetNpadStyleSet(id); size_t total_out=0; - if (style_set & HidNpadStyleTag_NpadFullKey) { + if (style_set & HidNpadStyleTag_NpadSystemExt) { + HidNpadSystemExtState state={0}; + total_out = hidGetNpadStatesSystemExt(id, &state, 1); + if (total_out) { + g_controllerHeld[i] |= state.buttons; + memcpy(&g_controllerEntries[i], &state, sizeof(state)); + } + } + else if (style_set & HidNpadStyleTag_NpadSystem) { + HidNpadSystemState state={0}; + total_out = hidGetNpadStatesSystem(id, &state, 1); + if (total_out) { + g_controllerHeld[i] |= state.buttons; + memcpy(&g_controllerEntries[i], &state, sizeof(state)); + } + } + else if (style_set & HidNpadStyleTag_NpadFullKey) { HidNpadFullKeyState state={0}; total_out = hidGetNpadStatesFullKey(id, &state, 1); if (total_out) { @@ -246,22 +262,6 @@ void hidScanInput(void) { memcpy(&g_controllerEntries[i], &state, sizeof(state)); } } - else if (style_set & HidNpadStyleTag_NpadSystemExt) { - HidNpadSystemExtState state={0}; - total_out = hidGetNpadStatesSystemExt(id, &state, 1); - if (total_out) { - g_controllerHeld[i] |= state.buttons; - memcpy(&g_controllerEntries[i], &state, sizeof(state)); - } - } - else if (style_set & HidNpadStyleTag_NpadSystem) { - HidNpadSystemState state={0}; - total_out = hidGetNpadStatesSystem(id, &state, 1); - if (total_out) { - g_controllerHeld[i] |= state.buttons; - memcpy(&g_controllerEntries[i], &state, sizeof(state)); - } - } g_controllerDown[i] = (~g_controllerOld[i]) & g_controllerHeld[i]; g_controllerUp[i] = g_controllerOld[i] & (~g_controllerHeld[i]);