Commit a98c477bc8228745e7de8d445098d8932e0ccaef

Edward Rudd 2014-02-04T15:40:51

allow safely quitting the hotplug test by pressing button 0 on the joystick

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/test/testhotplug.c b/test/testhotplug.c
index d4f64bb..173ff2d 100644
--- a/test/testhotplug.c
+++ b/test/testhotplug.c
@@ -113,6 +113,10 @@ main(int argc, char *argv[])
                     {
                         SDL_HapticRumblePlay(haptic, 0.2, 250);
                     }
+					if (event.jbutton.button == 0) {
+						SDL_Log("Exiting due to button press of button 0\n");
+						keepGoing = SDL_FALSE;
+					}
                     break;
                 case SDL_JOYBUTTONUP:
                     SDL_Log("Button Release: %d\n", event.jbutton.button);