# SDL_GameControllerEventState

Query or change current state of Game Controller events.

## Header File

Defined in [SDL_gamecontroller.h](https://github.com/libsdl-org/SDL/blob/SDL2/include/SDL_gamecontroller.h)

## Syntax

```c
int SDL_GameControllerEventState(int state);
```

## Function Parameters

|     |           |                                                                                                    |
| --- | --------- | -------------------------------------------------------------------------------------------------- |
| int | **state** | can be one of [`SDL_QUERY`](SDL_QUERY), [`SDL_IGNORE`](SDL_IGNORE), or [`SDL_ENABLE`](SDL_ENABLE). |

## Return Value

(int) Returns the same value passed to the function, with exception to -1
([SDL_QUERY](SDL_QUERY)), which will return the current state.

## Remarks

If controller events are disabled, you must call
[SDL_GameControllerUpdate](SDL_GameControllerUpdate)() yourself and check
the state of the controller when you want controller information.

Any number can be passed to
[SDL_GameControllerEventState](SDL_GameControllerEventState)(), but only
-1, 0, and 1 will have any effect. Other numbers will just be returned.

## Version

This function is available since SDL 2.0.0.

## See Also

- [SDL_JoystickEventState](SDL_JoystickEventState)

----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryGameController](CategoryGameController)