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

> 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](/reference/input/gameinput/functions/gameinputkeyboardlayoutcallback)

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](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback) and [IGameInput::StopCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback) methods. For intermediate and advanced use-cases of the GameInput API, see [Advanced GameInput topics](/build/core-features/common/input/advanced/input-advanced-topics).

## Requirements

The `RegisterKeyboardLayoutCallback` method registers a callback function when a keyboard layout is changed. For related information, see the [IGameInput::UnregisterCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback) and [IGameInput::StopCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_stopcallback) methods. For intermediate and advanced use-cases of the GameInput API, see [Advanced GameInput topics](/build/core-features/common/input/advanced/input-advanced-topics).

**Header:** GameInput.h

[Overview of GameInput](/build/core-features/common/input/overviews/input-overview)\
[IGameInput](/reference/input/gameinput/interfaces/igameinput/igameinput)

## Version History

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


## Related topics

- [GameInputKeyboardLayoutCallback](/reference/input/gameinput/functions/gameinputkeyboardlayoutcallback.md)
- [IGameInput::RegisterDeviceCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [IGameInput::RegisterReadingCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerreadingcallback.md)
- [IGameInput::RegisterSystemButtonCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registersystembuttoncallback.md)
- [IGameInput::RegisterGuideButtonCallback](/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_registerguidebuttoncallback.md)
