#153382 - DLightning - Sat Mar 29, 2008 1:51 pm
Hey there, I'm pretty new to DS programming, and I don't know what I've done wrong.
I've made a button checker program, if e.g. the A button is pressed, it should say:
The A button is pressed.
But when I run the .nds file in DeSmuME, it keeps saying: (e.g.) A button is released when I press it!
Here's the code:
main.c
Nds.h from libnds.
Contents of stdio.h:
Please help me out!
I've made a button checker program, if e.g. the A button is pressed, it should say:
The A button is pressed.
But when I run the .nds file in DeSmuME, it keeps saying: (e.g.) A button is released when I press it!
Here's the code:
main.c
Code: |
#include <nds.h>
#include <stdio.h> int main(void) { consoleDemoInit(); while(1) { scanKeys(); int held = keysHeld(); if( held & KEY_A) printf("Key A is pressed\n"); else printf("Key A is released\n"); if( held & KEY_B) printf("Key B is pressed\n"); else printf("Key B is released\n"); if( held & KEY_X) printf("Key X is pressed\n"); else printf("Key X is released\n"); if( held & KEY_Y) printf("Key Y is pressed\n"); else printf("Key Y is released\n"); if( held & KEY_TOUCH) printf("Touch pad is touched\n"); else printf("Touch pad is not touched\n"); swiWaitForVBlank(); consoleClear(); } return 0; } |
Nds.h from libnds.
Contents of stdio.h:
Code: |
mod note: removed, we all have the same file, not sure what it adds to the thread. |
Please help me out!