sdlGameControllerGetBindForButton function

SdlGameControllerButtonBind sdlGameControllerGetBindForButton(
  1. Pointer<SdlGameController> gamecontroller,
  2. int button
)

Get the SDL joystick layer binding for a controller button mapping.

\param gamecontroller a game controller \param button an button enum value (an SDL_GameControllerButton value) \returns a SDL_GameControllerButtonBind describing the bind. On failure (like the given Controller button doesn't exist on the device), its .bindType will be SDL_CONTROLLER_BINDTYPE_NONE.

\since This function is available since SDL 2.0.0.

\sa SDL_GameControllerGetBindForAxis

extern DECLSPEC SDL_GameControllerButtonBind SDLCALL SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)

Implementation

SdlGameControllerButtonBind sdlGameControllerGetBindForButton(
    Pointer<SdlGameController> gamecontroller, int button) {
  final sdlGameControllerGetBindForButtonLookupFunction =
      libSdl2.lookupFunction<
          SdlGameControllerButtonBind Function(
              Pointer<SdlGameController> gamecontroller, Int32 button),
          SdlGameControllerButtonBind Function(
              Pointer<SdlGameController> gamecontroller,
              int button)>('SDL_GameControllerGetBindForButton');
  return sdlGameControllerGetBindForButtonLookupFunction(
      gamecontroller, button);
}