sdl isnt that hard to work with and i think freespace already uses it. heres some code from the nukesim engine.
SDL_Joystick *stick;
int numaxes;
if(SDL_NumJoysticks())
{
stick = SDL_JoystickOpen(0);
numaxes = SDL_JoystickNumAxes(stick);
}
its kinda preliminary so far, this pretty much looks for a joystick, if it finds it it opens the first one, producing a handle, and puts the number of axes into numaxes. for a system which uses multiple joysticks, you get the number of joysticks, iterate through them, count the axes on each, generate some mapping data. to get at the raw joystick data you do something like this:
int joyaxes[6] = {0,0,0,0,0,0};
if(stick && numaxes > 0) //get joystick state
{
SDL_JoystickUpdate();
for (unsigned i=0; i < numaxes; i++)
{
joyaxes[i] = SDL_JoystickGetAxis(stick, i);
}
}