mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
reboot_to_payload: Update for new libnx HID interface
This commit is contained in:
parent
f86059de70
commit
3fd59b61bc
1 changed files with 9 additions and 11 deletions
|
@ -54,6 +54,11 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
consoleInit(NULL);
|
consoleInit(NULL);
|
||||||
|
|
||||||
|
padConfigureInput(8, HidNpadStyleSet_NpadStandard);
|
||||||
|
|
||||||
|
PadState pad;
|
||||||
|
padInitializeAny(&pad);
|
||||||
|
|
||||||
bool can_reboot = true;
|
bool can_reboot = true;
|
||||||
Result rc = splInitialize();
|
Result rc = splInitialize();
|
||||||
if (R_FAILED(rc)) {
|
if (R_FAILED(rc)) {
|
||||||
|
@ -76,20 +81,13 @@ int main(int argc, char **argv)
|
||||||
// Main loop
|
// Main loop
|
||||||
while(appletMainLoop())
|
while(appletMainLoop())
|
||||||
{
|
{
|
||||||
//Scan all the inputs. This should be done once for each frame
|
padUpdate(&pad);
|
||||||
hidScanInput();
|
u64 kDown = padGetButtonsDown(&pad);
|
||||||
|
|
||||||
u64 kDown = 0;
|
if (can_reboot && (kDown & HidNpadButton_Minus)) {
|
||||||
|
|
||||||
for (int controller = 0; controller < 10; controller++) {
|
|
||||||
// hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
|
|
||||||
kDown |= hidKeysDown((HidControllerID) controller);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (can_reboot && kDown & KEY_MINUS) {
|
|
||||||
reboot_to_payload();
|
reboot_to_payload();
|
||||||
}
|
}
|
||||||
if (kDown & KEY_L) { break; } // break in order to return to hbmenu
|
if (kDown & HidNpadButton_L) { break; } // break in order to return to hbmenu
|
||||||
|
|
||||||
consoleUpdate(NULL);
|
consoleUpdate(NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue