Steering Wheel

I’m having a problem with using a USB steering wheel. For some reason,
the SDL_JoystickNumButtons() function is returning the wrong number of
buttons. I’m not doing anything fancy, just . . .

joystick = SDL_JoystickOpen(which);
if(joystick == NULL){
return(1);
}//end if

int numButtons = SDL_JoystickNumButtons();

. . . this returns two more buttons than are present on my steering
wheel. I tested things a little with a program I found called
SDLJoytest that simply displays “lights” for all of the buttons found,
and makes them red when they are pressed down.

Any ideas?

Christian

I’m going out on a limb here, but my guess would be that the driver is
counting peddles, which are probably optional for your wheel and
possibly not present (I know the wheels logitech sells now has the
peddles seperate). If this is the case it’s not SDL’s fault and you
just need to see if you can get the name of the device (through
joystick calls) and have logic to ignore the extra buttons.

Christian Allgood wrote:> I’m having a problem with using a USB steering wheel. For some reason,

the SDL_JoystickNumButtons() function is returning the wrong number of
buttons. I’m not doing anything fancy, just . . .

joystick = SDL_JoystickOpen(which);
if(joystick == NULL){
return(1);
}//end if

int numButtons = SDL_JoystickNumButtons();

. . . this returns two more buttons than are present on my steering
wheel. I tested things a little with a program I found called
SDLJoytest that simply displays “lights” for all of the buttons found,
and makes them red when they are pressed down.

Any ideas?

Christian


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl