Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ControllerDeviceEventData contains a mislabeled field #306

Open
asivitz opened this issue Mar 28, 2024 · 1 comment
Open

ControllerDeviceEventData contains a mislabeled field #306

asivitz opened this issue Mar 28, 2024 · 1 comment

Comments

@asivitz
Copy link

asivitz commented Mar 28, 2024

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
Copy link
Author

asivitz commented Mar 28, 2024

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant