We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 267

Summary: Joystick is not detected
Product: SDL Reporter: Ondrej Danek <ondrej.danek>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: williamMedrano94
Version: 1.2.11   
Hardware: x86   
OS: Windows (All)   

Description Ondrej Danek 2006-06-27 14:53:06 UTC
Many users have complained to me that their joysticks are not detected in my SDL app when they run it under Windows. I did some research on this and i think i have found the problem:

At line 170 in SDL_mmjoystick.c it says:
  result = joyGetPosEx(SYS_JoystickID[i], &joyinfo);
but if you look closer at the code you see that SDL_JoystickID[i] is always zero. So for example when their joystick is assigned to the second position in the windows "driver" and the first position is empty, then it is never detected, because it always returns JOYERR_UNPLUGGED.

I believe this line should look like this:
  result = joyGetPosEx(i, &joyinfo);
Comment 1 Ryan C. Gordon 2006-10-28 23:43:53 UTC
This patch is in Subversion now (revision #2888 for 1.2 branch, revision #2889 for 1.3 branch).

Thanks!

--ryan.