Kaktusen

asdf

Nov 3rd, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1.  
  2. #include <nds.h>
  3. #include <stdio.h>
  4.  
  5.  
  6. void OnKeyPressed(int key) {
  7. if(key > 0)
  8. iprintf("%c", key);
  9. }
  10.  
  11. int main(void) {
  12.  
  13. consoleDemoInit();
  14.  
  15. Keyboard *kbd = keyboardDemoInit();
  16.  
  17. kbd->OnKeyPressed = OnKeyPressed;
  18.  
  19. while(1) {
  20. char myName[256];
  21.  
  22. iprintf("What is your name?\n");
  23.  
  24. scanf("%s", myName);
  25.  
  26. iprintf("\nHello %s", myName);
  27.  
  28. scanKeys();
  29. while(!keysDown())scanKeys();
  30.  
  31. swiWaitForVBlank();
  32. consoleClear();
  33. }
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment