> ## 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.

# 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](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md) method. For intermediate and advanced use-cases of the GameInput API, see [Advanced GameInput topics](https://docs.xbox.com/build/core-features/common/input/advanced/input-advanced-topics.md).

## Requirements

**Header:** GameInput.h

[Overview of GameInput](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputReading](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)

## Version History

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


## Related topics

- [GetKeyState](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/methods/igameinputreading_getkeystate.md)
- [GameInput keyboard and mouse](https://docs.xbox.com/build/core-features/common/input/advanced/input-keyboard-mouse.md)
- [IGameInputReading (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputreading/igameinputreading.md)
- [PFLobbyGetMemberPropertyKeys](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetmemberpropertykeys.md)
- [PFLobbyGetLobbyPropertyKeys](https://docs.xbox.com/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbygetlobbypropertykeys.md)
