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

# GameInputDeviceCallback

> GameInputDeviceCallback

# GameInputDeviceCallback

Title-defined callback for device connected and disconnected events. This function is registered with [IGameInput::RegisterDeviceCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback). 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](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback).

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

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

*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](/reference/input/gameinput/enums/gameinputdevicestatus)

Current connection and input status of the device.

*previousStatus*   \_In\_\
Type: [GameInputDeviceStatus](/reference/input/gameinput/enums/gameinputdevicestatus)

Previous connection and input status of the device.

### Return value

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

## Version History

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


## Related topics

- [IGameInput::RegisterDeviceCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [GameInput](/reference/input/gameinput/gameinput_members.md)
- [GameInput callbacks](/build/core-features/common/input/advanced/input-callbacks.md)
- [GameInputDeviceStatus](/reference/input/gameinput/enums/gameinputdevicestatus.md)
- [GameInputKeyboardLayoutCallback](/reference/input/gameinput/functions/gameinputkeyboardlayoutcallback.md)
