> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::GetControllerButtonCount

> Obtém o número de botões de controle genérico no dispositivo.

Obtém o número de botões de controle genérico no dispositivo.

## Sintaxe

```cpp theme={null}
uint32_t GetControllerButtonCount();
```

### Parâmetros

Este método não tem parâmetros.

### Valor retornado

Tipo: uint32\_t

O número de botões de controle no dispositivo ou 0 se o dispositivo não tiver botões de controle.

## Comentários

Os botões de controle são os botões brutos e não mapeados de um dispositivo. Um dispositivo tem botões de controle quando o valor retornado por [GetSupportedInput](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedinput.md) inclui `GameInputKindControllerButton`. As leituras do dispositivo que incluem `GameInputKindControllerButton` relatam o mesmo número de botões por meio de [IGameInputReading::GetControllerButtonCount](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md).

Use o valor retornado para dimensionar a matriz que você passa para [GetControllerButtonLabels](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttonlabels.md) ou para [IGameInputReading::GetControllerButtonState](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md). O número de botões não muda enquanto o dispositivo está conectado.

No GameInput v3 e anteriores, essas informações estavam disponíveis no membro `controllerButtonCount` da estrutura [GameInputControllerInfo](https://docs.xbox.com/pt-BR/reference/input/gameinput/deprecated/structs/gameinputcontrollerinfo.md), referenciada pelo membro `controllerInfo` da estrutura [GameInputDeviceInfo](https://docs.xbox.com/pt-BR/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) retornada por [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/pt-BR/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md).

## Requisitos

**Cabeçalho:** GameInput.h

**Biblioteca:** gameinput.lib

**Plataformas com suporte:** Windows, consoles da família XBOX One e consoles XBOX Series

## Confira também

[Visão geral do GameInput](https://docs.xbox.com/pt-BR/build/core-features/common/input/overviews/input-overview.md)\
[GetControllerButtonLabels](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttonlabels.md)\
[IGameInputReading::GetControllerButtonCount](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md)\
[IGameInputReading::GetControllerButtonState](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttonstate.md)\
[IGameInputDevice](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## Histórico de versões

| Versão | Alterações |
| - | - |
| **v4** | Introduzido. |


## Related topics

- [IGameInputDevice::GetControllerButtonLabels](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerbuttonlabels.md)
- [GetControllerButtonCount](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md)
- [IGameInputDevice::GetControllerSwitchCount](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrollerswitchcount.md)
- [IGameInputDevice::GetControllerAxisCount](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxiscount.md)
- [IGameInputDevice::GetControllerAxisLabels](https://docs.xbox.com/pt-BR/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getcontrolleraxislabels.md)
