Skip to content

Should getControllerID be removed? #305

@asivitz

Description

@asivitz

I tried

  cds <- SDL.availableControllers
  gcs <- for cds SDL.openController
  gcids <- for gcs SDL.getControllerID

which gave me

SDLCallFailed {sdlExceptionCaller = "SDL.Input.GameController.getControllerID", sdlFunction = "SDL_JoystickInstanceID", sdlExceptionError = "Parameter 'joystick' is invalid"}

After a little digging, I see the markdown for getControllerID has

See [SDL_GameControllerInstanceID](https://wiki.libsdl.org/SDL_GameControllerInstanceID) for C documentation.

but that function (SDL_GameControllerInstanceID) doesn't seem to exist.

And the binding actually calls "SDL_JoystickInstanceID" which expects a joystick, not a controller, hence the error.

So what is the point of this function? It doesn't seem to map to any SDL functionality. If the point is to match up a controller to an event, I believe the intention is to use SDL_GameControllerFromInstanceID (basically go the other way from instance id to controller).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions