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

# IGameInput::RegisterReadingCallback

> IGameInput::RegisterReadingCallback

# IGameInput::RegisterReadingCallback

Registers a function to be called when a new reading arrives in the input stream.

## Syntax

```cpp theme={null}
HRESULT RegisterReadingCallback(
    IGameInputDevice* device,
    GameInputKind inputKind,
    void* context,
    GameInputReadingCallback callbackFunc,
    GameInputCallbackToken* callbackToken
);
```

### Parameters

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

Limits registered callback to only trigger for a specific device.

*inputKind*   \_In\_\
Type: [GameInputKind](/reference/input/gameinput/enums/gameinputkind)

Limits registered callback to only trigger for devices that support at least one of the specified types of input.

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

Some object which provides relevant information for the callback function. Typically the calling object.

*callbackFunc*   \_In\_\
Type: GameInputReadingCallback

Title defined callback function.

*callbackToken*   \_Result\_zeroonfailure\_\
Type: GameInputCallbackToken\*

Token identifying the registered callback function. This token will be used to identify the registered function in the event that you would like to cancel or unregister the callback function.

### Return value

Type: HRESULT

Function result.

## Remarks

Registering a callback does not cause an initial callback to be dispatched with the most current reading that matches the supplied input filter. It only causes callbacks to be dispatched for subsequent state changes.

## Requirements

**Header:** GameInput.h

[Input API Overview](/build/core-features/common/input/overviews/input-overview)\
[IGameInput](/reference/input/gameinput/interfaces/igameinput/igameinput)\
[IGameInput::UnregisterCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback)\
[IGameInput::StopCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback)

## Version History

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


## Related topics

- [GameInputReadingCallback](/reference/input/gameinput/functions/gameinputreadingcallback.md)
- [IGameInput::StopCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback.md)
- [IGameInput::FindDeviceFromId](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md)
- [IGameInput::UnregisterCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md)
- [IGameInput::RegisterDeviceCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
