sdl2 icon indicating copy to clipboard operation
sdl2 copied to clipboard

ControllerDeviceEventData contains a mislabeled field

Open asivitz opened this issue 11 months ago • 1 comments

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.

asivitz avatar Mar 28 '24 20:03 asivitz

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.

asivitz avatar Mar 28 '24 20:03 asivitz