sdl2
sdl2 copied to clipboard
ControllerDeviceEventData contains a mislabeled field
ControllerDeviceEventData (corresponding to SDL_CONTROLLERDEVICEADDED) has a 'which' field. The haskell binding claims this is a Joystick Instance ID. Instead this appears to be a device id, which makes sense because after the controller connects you would want to open it, which requires the device id. The joystick id would not exist until it's opened.
Ah, I believe the confusion arises from the fact that the disconnect (SDL_CONTROLLERDEVICEREMOVED) would have a joystick instance id as the 'which' field. So the underlying SDL2 library is playing loose with types.