| Summary: | SDL_CONTROLLERDEVICEADDED not fired for Xbox360 controller | ||
|---|---|---|---|
| Product: | SDL | Reporter: | BurnSpamAddress |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 7 | ||
|
Description
BurnSpamAddress
2013-12-22 22:48:09 UTC
Querying the device through the joystick API gives: 'XInput Controller #1' has 6 axes, 15 buttons, 0 hats, 0 balls The JOYSTICK and GAMECONTROLLER subsystems are initialized without error. More information: if I connect the device after my application is up and running, then I correctly receive CONTROLLERDEVICEADDED/REMOVED events. If the device is connected before I start my application, then CONTROLLERDEVICEADDED/REMOVED events are *not* fired until I unplug&replug the device. Is this a bug in SDL2? If I ignore the fact that SDL.IsGameController() returns false and I open the device with SDL.GameControllerOpen() anyway, then SDL.GetError() returns the following message: "Couldn't find mapping for device (0)" If I unplug and replug the device then SDL.GameControllerOpen() works correctly. Please let me know if you need more information to trace this issue. This issue is also reproducible in hg 8064. Added events should be generated at init for supported controllers with this commit: http://hg.libsdl.org/SDL/rev/8314a9008bf1 What is the output of testgamecontroller 0 with that controller plugged in? Thanks, with this patch the controller name is reported correctly when the controller is already connected. However, I am now getting random initialization errors: "CoInitialize() DirectX error -2147417850" This probably belongs to a different report. I also fixed the CoInitialize() errors. |