Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merged r3292:3293 from branches/SDL-1.2: testjoystick verbose info.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 15, 2007
1 parent e51cb16 commit 1d87944
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/testjoystick.c
Expand Up @@ -157,7 +157,17 @@ main(int argc, char *argv[])
printf("There are %d joysticks attached\n", SDL_NumJoysticks());
for (i = 0; i < SDL_NumJoysticks(); ++i) {
name = SDL_JoystickName(i);
printf("Joystick %d: %s\n", i, name ? name : "Unknown Joystick");
printf("Joystick %d: %s\n",i,name ? name : "Unknown Joystick");
joystick = SDL_JoystickOpen(i);
if (joystick == NULL) {
fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i, SDL_GetError());
} else {
printf(" axes: %d\n", SDL_JoystickNumAxes(joystick));
printf(" balls: %d\n", SDL_JoystickNumBalls(joystick));
printf(" hats: %d\n", SDL_JoystickNumHats(joystick));
printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick));
SDL_JoystickClose(joystick);
}
}

if (argv[1]) {
Expand Down

0 comments on commit 1d87944

Please sign in to comment.