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

# IGameInputReading::GetKeyCount

> IGameInputReading::GetKeyCount

# IGameInputReading::GetKeyCount

Retrieves the number of keys active on a keyboard.

## Syntax

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

### Parameters

This method has no parameters.

### Return value

Type: uint32\_t

This returns the number of keys active on a game controller.

## Remarks

The `IGameInputReading::GetKeyCount` method retrieves the number of keys active on a game controller. It is used to determine the number of arrays needed for [IGameInputReading::GetKeyState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate) method. For intermediate and advanced use-cases of the GameInput API, see [Advanced GameInput topics](/build/core-features/common/input/advanced/input-advanced-topics).

## Requirements

**Header:** GameInput.h

[Overview of GameInput](/build/core-features/common/input/overviews/input-overview)\
[IGameInputReading](/reference/input/gameinput/interfaces/igameinputreading/igameinputreading)

## Version History

| Version | Changes     |
| ------- | ----------- |
| **v0**  | Introduced. |


## Related topics

- [IGameInputReading::GetKeyState](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md)
- [IGameInputReading::GetTouchCount](/reference/input/gameinput/deprecated/interfaces/igameinputreading/methods/igameinputreading_gettouchcount.md)
- [IGameInputReading::GetControllerAxisCount](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrolleraxiscount.md)
- [IGameInputReading::GetControllerButtonCount](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerbuttoncount.md)
- [IGameInputReading::GetControllerSwitchCount](/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getcontrollerswitchcount.md)
