Skip to content

Commit ccd9f78

Browse files
committed
Imported more changes from 3ds-examples.
1 parent c889e7c commit ccd9f78

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

audio/playtone/source/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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
{

graphics/printing/hello-world/source/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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();

graphics/simplegfx/source/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

hid/irsensor/source/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)