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 484

Summary: Joystick button states fail to update
Product: SDL Reporter: Oskari Nyman <asko>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Windows (XP)   

Description Oskari Nyman 2007-08-28 11:45:52 UTC
Joystick button pushes are not detected for my USB joystick. It's probably a rare case, so before I scare you away, let me reveal the problem:

In /src/joystick/win32/SDL_mmjoystick.c, function SDL_SYS_JoystickUpdate()

JOYINFOEX joyinfo;
            ^
This struct should be zeroed out before using it, meaning:

ZeroMemory(&joyinfo, sizeof(joyinfo));

That fixes it.
Comment 1 Oskari Nyman 2007-08-28 12:21:39 UTC
Seems this is not the problem after all. Instead my joystick seems to shift the button state bits in joyinfo.dwButtons by 4 bits to the left. Obviously it's a problem in the joystick itself (it's custom made).

Windows control panel seems to detect this though, and shows 4 extra buttons. But there's nothing in the device caps that would indicate it, so it's probably not worth fixing.