Windows/SDL not showing correct name for joysticks

I vaguely remember this being mentioned a long time ago, but I can’t
remember the specifics.

Is there any way to get SDL_JoystickName() to give the same name as is
in the Control Panel in Windows? Right now, my 2 gamepads (plugged
into gamepad ports) show up as “Microsoft PC-joystick”, but in the
Control Panel they’re labelled as “Gravis Gamepad Pro” and “2 axis, 4
button …”.

The reason I ask is that I’m trying to add Stelladaptor support to
Stella (Atari 2600 emulator), and it’s a USB device identified by
"Stelladaptor 2600-to-USB Interface".

If I could get SDL_JoystickName() to identify it using
"Stelladaptor …", I could automagically detect and configure it
without any input from the user.

Is this a bug in SDL, or in Windows?

Thanks for any help,
Steve

This is probably because SDL uses the old “Multimedia API” (joyGetNumDevs,
etc), and not DirectInput.

I posted some code a long while back that rewrote the driver to use DI5:

http://cvs.sourceforge.net/viewcvs.py/stepmania/stepmania/src/SDL-1.2.5/src/joystick/win32dx/Attic/SDL_dxjoystick.c?rev=1.5&hideattic=0&view=auto

I no longer use SDL for input in Windows, so I never pushed for inclusion
of this.

It solved some other problems, too, but I’m not entirely sure what they
were. (I think MMAPI only reports the first two joysticks?)On Fri, May 07, 2004 at 03:17:29PM -0230, Stephen Anthony wrote:

Is there any way to get SDL_JoystickName() to give the same name as is
in the Control Panel in Windows? Right now, my 2 gamepads (plugged
into gamepad ports) show up as “Microsoft PC-joystick”, but in the
Control Panel they’re labelled as “Gravis Gamepad Pro” and “2 axis, 4
button …”.


Glenn Maynard

Stephen Anthony wrote:

Is there any way to get SDL_JoystickName() to give the same name as is
in the Control Panel in Windows? Right now, my 2 gamepads (plugged
into gamepad ports) show up as “Microsoft PC-joystick”, but in the
Control Panel they’re labelled as “Gravis Gamepad Pro” and “2 axis, 4
button …”.

You can completely rewrite the Windows joystick handling code. Short of
that, no.

Is this a bug in SDL, or in Windows?

Both. SDL is getting the joystick name from the old Windows joystick API.
I assume that switching to the DirectInput API would solve this problem.–
Rainer Deyke - rainerd at eldwood.com - http://eldwood.com

Hello everyone,

Is there any way to get SDL_JoystickName() to give the same name as is
in the Control Panel in Windows?
[…]

This is probably because SDL uses the old “Multimedia API” (joyGetNumDevs,
etc), and not DirectInput.
I posted some code a long while back that rewrote the driver to use DI5:
[…]
I no longer use SDL for input in Windows, so I never pushed for inclusion
of this.
It solved some other problems, too, but I’m not entirely sure what they
were. (I think MMAPI only reports the first two joysticks?)

I’m not a Windows programmer, so this is actually why I use SDL for
input: so that I don’t have to be for my code to be portable.

If the current system is outdated and (for some purposes) broken, and
newer joystick code exists, then I’d vote for including the new system,
i.e. DirectInput. Or is there a reason to keep olny the old joystick
input methods (instead of two internal alternatives with the same API?)

Just my two cents,

Benjamin

I vaguely remember this being mentioned a long time ago, but I can’t
remember the specifics.

Is there any way to get SDL_JoystickName() to give the same name as is
in the Control Panel in Windows? Right now, my 2 gamepads (plugged
into gamepad ports) show up as “Microsoft PC-joystick”, but in the
Control Panel they’re labelled as “Gravis Gamepad Pro” and “2 axis, 4
button …”.

Try the latest CVS code. There was a patch submitted for this recently.

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment