File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
printing/hello-world/source Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ int main(int argc, char **argv)
6464 //Scan all the inputs. This should be done once for each frame
6565 hidScanInput ();
6666
67- if (hidKeysDown (CONTROLLER_P1_AUTO ) & KEY_PLUS ) break ; // break in order to return to hbmenu
67+ //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
68+ u32 kDown = hidKeysDown (CONTROLLER_P1_AUTO );
69+
70+ if (kDown & KEY_PLUS ) break ; // break in order to return to hbmenu
6871
6972 if (hidKeysDown (CONTROLLER_P1_AUTO ) & KEY_A )
7073 {
Original file line number Diff line number Diff line change @@ -20,7 +20,10 @@ int main(int argc, char **argv)
2020 //Scan all the inputs. This should be done once for each frame
2121 hidScanInput ();
2222
23- if (hidKeysDown (CONTROLLER_P1_AUTO ) & KEY_PLUS ) break ; // break in order to return to hbmenu
23+ //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
24+ u32 kDown = hidKeysDown (CONTROLLER_P1_AUTO );
25+
26+ if (kDown & KEY_PLUS ) break ; // break in order to return to hbmenu
2427
2528 gfxFlushBuffers ();
2629 gfxSwapBuffers ();
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ int main(int argc, char **argv)
2929 //Scan all the inputs. This should be done once for each frame
3030 hidScanInput ();
3131
32- if (hidKeysDown (CONTROLLER_P1_AUTO ) & KEY_PLUS ) break ; // break in order to return to hbmenu
32+ //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
33+ u32 kDown = hidKeysDown (CONTROLLER_P1_AUTO );
34+
35+ if (kDown & KEY_PLUS ) break ; // break in order to return to hbmenu
3336
3437 u32 width , height ;
3538 u32 pos ;
Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ int main(int argc, char **argv)
3535 //Scan all the inputs. This should be done once for each frame
3636 hidScanInput ();
3737
38- if (hidKeysDown (CONTROLLER_P1_AUTO ) & KEY_PLUS ) break ; // break in order to return to hbmenu
38+ //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame)
39+ u32 kDown = hidKeysDown (CONTROLLER_P1_AUTO );
40+
41+ if (kDown & KEY_PLUS ) break ; // break in order to return to hbmenu
3942
4043 gfxFlushBuffers ();
4144 gfxSwapBuffers ();
You can’t perform that action at this time.
0 commit comments