test/controllermap.c
changeset 8046 e7c89b29932a
parent 8043 74fcbf6987ba
child 8048 a9c5ddad50b0
     1.1 --- a/test/controllermap.c	Mon Dec 02 23:54:35 2013 -0800
     1.2 +++ b/test/controllermap.c	Tue Dec 03 12:01:28 2013 -0300
     1.3 @@ -144,7 +144,7 @@
     1.4      };
     1.5  
     1.6      /* Create a window to display joystick axis position */
     1.7 -    window = SDL_CreateWindow("Joystick Test", SDL_WINDOWPOS_CENTERED,
     1.8 +    window = SDL_CreateWindow("Game Controller Map", SDL_WINDOWPOS_CENTERED,
     1.9                                SDL_WINDOWPOS_CENTERED, SCREEN_WIDTH,
    1.10                                SCREEN_HEIGHT, 0);
    1.11      if (window == NULL) {
    1.12 @@ -178,6 +178,7 @@
    1.13      Press the buttons on your controller when indicated\n\
    1.14      (Your controller may look different than the picture)\n\
    1.15      If you want to correct a mistake, press backspace or the back button on your device\n\
    1.16 +    To skip a button, press SPACE or click/touch the screen\n\
    1.17      To exit, press ESC\n\
    1.18      ====================================================================================\n");
    1.19      
    1.20 @@ -287,6 +288,12 @@
    1.21                          next=SDL_TRUE;
    1.22                      }
    1.23                      break;
    1.24 +                case SDL_FINGERDOWN:
    1.25 +                case SDL_MOUSEBUTTONDOWN:
    1.26 +                    /* Skip this step */
    1.27 +                    s++;
    1.28 +                    next=SDL_TRUE;
    1.29 +                    break;
    1.30                  case SDL_KEYDOWN:
    1.31                      if (event.key.keysym.sym == SDLK_BACKSPACE || event.key.keysym.sym == SDLK_AC_BACK) {
    1.32                          /* Undo! */
    1.33 @@ -297,12 +304,17 @@
    1.34                          }
    1.35                          break;
    1.36                      }
    1.37 +                    if (event.key.keysym.sym == SDLK_SPACE) {
    1.38 +                        /* Skip this step */
    1.39 +                        s++;
    1.40 +                        next=SDL_TRUE;
    1.41 +                        break;
    1.42 +                    }
    1.43 +                    
    1.44                      if ((event.key.keysym.sym != SDLK_ESCAPE)) {
    1.45                          break;
    1.46                      }
    1.47                      /* Fall through to signal quit */
    1.48 -                case SDL_FINGERDOWN:
    1.49 -                case SDL_MOUSEBUTTONDOWN:
    1.50                  case SDL_QUIT:
    1.51                      done = SDL_TRUE;
    1.52                      break;