#pragma section-numbers off #pragma camelcase off || DRAFT|| ##*^*^*^*^*See http://wiki.libsdl.org/moin.cgi/SGFunctions for details on editing this page*^*^*^*^* = SDL_GameControllerGetButton = Use this function to get the current state of a button on a game controller. <> == Syntax == {{{#!highlight cpp Uint8 SDL_GameControllerGetButton(SDL_GameController* gamecontroller, SDL_GameControllerButton button) }}} == Function Parameters == ||'''gamecontroller'''||a game controller|| ||'''button'''||a button index (one of the [[SDL_GameControllerButton]] values)|| ##Fill in the above table per the Style Guide, then delete this comment. == Return Value == Returns 1 for pressed state or 0 for not pressed state or error; call [[SDL_GetError]]() for more information. == Code Examples == {{{#!highlight cpp You can add your code example here }}} ##Leave this section as-is unless you have a code example to put in. In that case, replace You can add your code example here with your code example following the Style Guide instructions. Leave the rest of the markup alone and delete this comment. == Remarks == The button indices start at index 0. == Version == This function is available since SDL 2.0.0. == Related Functions == .[[SDL_GameControllerGetAxis]] ---- [[CategoryAPI]], [[CategoryGameController]] ##See the Style Guide for instructions on editing the footer.