diff --git a/audio/playtone/source/main.c b/audio/playtone/source/main.c index f8a9203..1e980d7 100644 --- a/audio/playtone/source/main.c +++ b/audio/playtone/source/main.c @@ -64,7 +64,10 @@ int main(int argc, char **argv) //Scan all the inputs. This should be done once for each frame hidScanInput(); - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; // break in order to return to hbmenu + //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) + u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + + if (kDown & KEY_PLUS) break; // break in order to return to hbmenu if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_A) { diff --git a/graphics/printing/hello-world/source/main.c b/graphics/printing/hello-world/source/main.c index f34df36..bcb1229 100644 --- a/graphics/printing/hello-world/source/main.c +++ b/graphics/printing/hello-world/source/main.c @@ -20,7 +20,10 @@ int main(int argc, char **argv) //Scan all the inputs. This should be done once for each frame hidScanInput(); - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; // break in order to return to hbmenu + //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) + u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + + if (kDown & KEY_PLUS) break; // break in order to return to hbmenu gfxFlushBuffers(); gfxSwapBuffers(); diff --git a/graphics/simplegfx/source/main.c b/graphics/simplegfx/source/main.c index d571a28..a4dd81e 100644 --- a/graphics/simplegfx/source/main.c +++ b/graphics/simplegfx/source/main.c @@ -29,7 +29,10 @@ int main(int argc, char **argv) //Scan all the inputs. This should be done once for each frame hidScanInput(); - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; // break in order to return to hbmenu + //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) + u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + + if (kDown & KEY_PLUS) break; // break in order to return to hbmenu u32 width, height; u32 pos; diff --git a/hid/irsensor/source/main.c b/hid/irsensor/source/main.c index d851ae5..494c18b 100644 --- a/hid/irsensor/source/main.c +++ b/hid/irsensor/source/main.c @@ -35,7 +35,10 @@ int main(int argc, char **argv) //Scan all the inputs. This should be done once for each frame hidScanInput(); - if (hidKeysDown(CONTROLLER_P1_AUTO) & KEY_PLUS) break; // break in order to return to hbmenu + //hidKeysDown returns information about which buttons have been just pressed (and they weren't in the previous frame) + u32 kDown = hidKeysDown(CONTROLLER_P1_AUTO); + + if (kDown & KEY_PLUS) break; // break in order to return to hbmenu gfxFlushBuffers(); gfxSwapBuffers();