urho3d/Urho3D — pull request #317 by thebluefish (2014-04-18 00:43:18+00:00)
Title: Fixed joystick support

Completed changes necessary to migrate from SDL1.3 API to SDL2 API.
- Removed reliance on SDL1.3 API functions.
- Added support for events SDL_JOYDEVICEADDED and SDL_JOYDEVICEREMOVED.
- Added Urho3D events E_JOYSTICKCONNECTEDand E_E_JOYSTICKDISCONNECTED.
- Added SDL_JoystickID as a JoystickState variable.
- All joysticks are open by default. All joystick events will receive the InstanceID of the joystick for application-level control.
- SDL_JoystickID is now used instead of the Joystick index. This way, the order that joysticks connect does not matter. If a joystick or controller gets disconnected, and then later reconnects during the same game session, it will retain the same SDL_JoystickID.

Note: Virtual (on-screen) joysticks should still work, but has not been tested.

I have tested a generic joystick (with hat) and an Xbox 360 controller, both working as expected.