test/testjoystick.c
changeset 10707 28c1a3f9c88b
parent 10597 7b2a0f5a4380
child 10737 3406a0f8b041
equal deleted inserted replaced
10706:71ce5d7d2610 10707:28c1a3f9c88b
   319                 SDL_WaitEvent(&event);
   319                 SDL_WaitEvent(&event);
   320                 if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN)
   320                 if ((event.type == SDL_QUIT) || (event.type == SDL_FINGERDOWN)
   321                     || (event.type == SDL_MOUSEBUTTONDOWN)) {
   321                     || (event.type == SDL_MOUSEBUTTONDOWN)) {
   322                     keepGoing = SDL_FALSE;
   322                     keepGoing = SDL_FALSE;
   323                 } else if (event.type == SDL_JOYDEVICEADDED) {
   323                 } else if (event.type == SDL_JOYDEVICEADDED) {
       
   324                     device = event.jdevice.which;
   324                     joystick = SDL_JoystickOpen(device);
   325                     joystick = SDL_JoystickOpen(device);
   325                     if (joystick != NULL) {
   326                     if (joystick != NULL) {
   326                         SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);
   327                         SDL_assert(SDL_JoystickFromInstanceID(SDL_JoystickInstanceID(joystick)) == joystick);
   327                     }
   328                     }
   328                     break;
   329                     break;