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

# GameInputDeviceCallback

> GameInputDeviceCallback

Title-defined callback for device connected and disconnected events. This function is registered with [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md). This function is triggered by the conditions set from the registration function.

## Syntax

```cpp theme={null}
void GameInputDeviceCallback(
    GameInputCallbackToken callbackToken,
    void* context,
    IGameInputDevice* device,
    uint64_t timestamp,
    GameInputDeviceStatus currentStatus,
    GameInputDeviceStatus previousStatus
);
```

### Parameters

*callbackToken*   \_In\_\
Type: GameInputCallbackToken

Callback token for the registered function. Token returned by [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md).

*context*   \_In\_\
Type: void\*

The context passed to [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md).

*device*   \_In\_\
Type: IGameInputDevice\*

Device which triggered the callback.

*timestamp*   \_In\_\
Type: uint64\_t

Microsecond timestamp denoting when the status change occurred.

*currentStatus*   \_In\_\
Type: [GameInputDeviceStatus](https://docs.xbox.com/reference/input/gameinput/enums/gameinputdevicestatus.md)

Current connection and input status of the device.

*previousStatus*   \_In\_\
Type: [GameInputDeviceStatus](https://docs.xbox.com/reference/input/gameinput/enums/gameinputdevicestatus.md)

Previous connection and input status of the device.

### Return value

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

## Version History

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


## Related topics

- [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [GameInput API members](https://docs.xbox.com/reference/input/gameinput/gameinput_members.md)
- [GameInput callbacks](https://docs.xbox.com/build/core-features/common/input/advanced/input-callbacks.md)
- [GameInput devices](https://docs.xbox.com/build/core-features/common/input/overviews/input-devices.md)
- [GameInputDeviceStatus](https://docs.xbox.com/reference/input/gameinput/enums/gameinputdevicestatus.md)
