switch-examples/templates/application/source/main.c
Thompson Lee d4cf965df9 Updated all hidKeys...() function to store u64 instead of u32. (#28)
Also fixed some whitespace in usbds example
2018-04-30 00:18:16 +02:00

35 lines
724 B
C

#include <string.h>
#include <stdio.h>
#include <switch.h>
int main(int argc, char **argv)
{
gfxInitDefault();
consoleInit(NULL);
printf("Hello World!");
// Main loop
while(appletMainLoop())
{
//Scan all the inputs. This should be done once for each frame
hidScanInput();
// Your code goes here
//hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
if (kDown & KEY_PLUS) break; // break in order to return to hbmenu
gfxFlushBuffers();
gfxSwapBuffers();
gfxWaitForVsync();
}
gfxExit();
return 0;
}