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

# IGameInput::CreateAggregateDevice

> IGameInput::CreateAggregateDevice

Creates a virtual [IGameInputDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) instance which aggregates all input of the specified [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md).

## Syntax

```cpp theme={null}
HRESULT CreateAggregateDevice(
         GameInputKind inputKind,
         APP_LOCAL_DEVICE_ID* deviceId
)
```

### Parameters

*inputKind*   \_In\_\
Type: [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md)

The type of input which the returned virtual [IGameInputDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) will aggregate readings for.

*deviceId*   \_Out\_\
Type: APP\_LOCAL\_DEVICE\_ID\*

The resulting device identifier for the aggregate device.

### Return value

Type: HRESULT

Function result. Failure returned when an unsupported [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md) is used or when attempting to combine [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md) flags.

## Remarks

The input kind used for CreateAggregateDevice must be a single value from the [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md) enumeration. Combining [GameInputKind](https://docs.xbox.com/reference/input/gameinput/enums/gameinputkind.md) flags is not supported. If an application needs aggregated input for multiple input kinds, it must create a virtual [IGameInputDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md) instance for each one.

> [!NOTE]
>
> This function is used to re-enable an aggregate device that may have been disabled by calling [DisableAggregateDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_disableaggregatedevice.md). It results in the device re-enabled rather than the creation of another instance.

The aggregate device will also emit status notification through callback registered by calling [RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md).

Aggregation is supported only for the following input kinds:

* GameInputKindKeyboard
* GameInputKindMouse
* GameInputKindArcadeStick
* GameInputKindFlightStick
* GameInputKindGamepad
* GameInputKindRacingWheel

## Requirements

**Header:** GameInput.h

[Input API Overview](https://docs.xbox.com/build/core-features/common/input/overviews/input-overview.md)\
[IGameInput](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/igameinput.md)

## Version History

| Version | Changes |
| - | - |
| **v3** | Implemented (previously E\_NOTIMPL in v0) and reintroduced. Signature changed: `IGameInputDevice**` replaced with `APP_LOCAL_DEVICE_ID*`. |
| **v1** | Removed. |
| **v0** | Introduced but unimplemented. |


## Related topics

- [IGameInput::DisableAggregateDevice](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_disableaggregatedevice.md)
- [IGameInput::CreateDispatcher](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_createdispatcher.md)
- [IGameInput::FindDeviceFromId](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md)
- [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [IGameInput::FindDeviceFromObject (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_finddevicefromobject.md)
