> ## 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::RegisterKeyboardLayoutCallback

> IGameInput::RegisterKeyboardLayoutCallback

Registers a callback function when a keyboard layout is changed.

## Syntax

```cpp theme={null}
HRESULT RegisterKeyboardLayoutCallback(
    IGameInputDevice* device,
    void* context,
    GameInputKeyboardLayoutCallback callbackFunc,
    GameInputCallbackToken* callbackToken
);
```

### Parameters

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

Optionally limits registered callback to trigger a specific device.

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

An object that provides relevant information for the callback function. Typically, it is the calling object.

*callbackFunc*   \_In\_\
Type: [GameInputKeyboardLayoutCallback](https://docs.xbox.com/reference/input/gameinput/functions/gameinputkeyboardlayoutcallback.md)

Title-defined callback function that is called when the keyboard layout is changed.

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

Token identifying the registered callback function. This token is used to identify the registered function if you need to cancel or unregister the callback function.

### Return value

Type: HRESULT

Function result.

## Remarks

The `RegisterKeyboardLayoutCallback` method registers a callback function when a keyboard layout is changed. For related information, see the [IGameInput::UnregisterCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md) and [IGameInput::StopCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback.md) methods. 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

The `RegisterKeyboardLayoutCallback` method registers a callback function when a keyboard layout is changed. For related information, see the [IGameInput::UnregisterCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md) and [IGameInput::StopCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback.md) methods. 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).

**Header:** GameInput.h

[Overview of GameInput](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 |
| - | - |
| **v0** | Introduced. |


## Related topics

- [GameInputKeyboardLayoutCallback](https://docs.xbox.com/reference/input/gameinput/functions/gameinputkeyboardlayoutcallback.md)
- [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [IGameInput::RegisterReadingCallback](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerreadingcallback.md)
- [IGameInput::RegisterGuideButtonCallback (Deprecated)](https://docs.xbox.com/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_registerguidebuttoncallback.md)
- [IGameInput (Interface contents)](https://docs.xbox.com/reference/input/gameinput/interfaces/igameinput/igameinput.md)
