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

# GameInputKeyboardLayoutCallback

> GameInputKeyboardLayoutCallback

# GameInputKeyboardLayoutCallback

Title-defined callback for the guide-button (pressed or released) event.

## Syntax

```cpp theme={null}
void GameInputKeyboardLayoutCallback(
    GameInputCallbackToken callbackToken,
    void * context,
    IGameInputDevice * device,
    uint64_t timestamp,
    uint32_t currentLayout,
    uint32_t previousLayout
);
```

### Parameters

*callbackToken*   \_In\_\
Type: GameInputCallbackToken

The callback token returned by [IGameInput::RegisterKeyboardLayoutCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerkeyboardlayoutcallback).

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

The title defined context passed to [IGameInput::RegisterKeyboardLayoutCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerkeyboardlayoutcallback).

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

The device that triggered the event.

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

The microsecond timestamp associated with the event.

*currentLayout*   \_In\_\
Type: uint32\_t

The new/current keyboard layout.

*previousLayout*   \_In\_\
Type: uint32\_t

The previous keyboard layout.

### Return value

Type: void

## Remarks

The `GameInputKeyboardLayoutCallback` function is used by the title-defined callback when the keyboard layout changes. It is registered with the [IGameInput::RegisterKeyboardLayoutCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerkeyboardlayoutcallback) method. This function is triggered by the conditions set from the registration method. For more information, see [Advanced GameInput topics](/build/core-features/common/input/advanced/input-advanced-topics).

The `currentLayout` and `previousLayout` parameters contain the Keyboard Layout ID values that are identical to those provided by the [GetKeyboardLayoutName](https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getkeyboardlayoutnamea) function, but expressed as a 32-bit integer instead of a string.

## Requirements

**Header:** GameInput.h

**Library:** gameinput.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[Overview of GameInput](/build/core-features/common/input/overviews/input-overview)<br />
[GameInput](/reference/input/gameinput/gameinput_members)

## Version History

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


## Related topics

- [IGameInput::RegisterKeyboardLayoutCallback](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerkeyboardlayoutcallback.md)
- [GameInput](/reference/input/gameinput/gameinput_members.md)
- [GameInputKeyboardInfo](/reference/input/gameinput/structs/gameinputkeyboardinfo.md)
- [IGameInput](/reference/input/gameinput/interfaces/igameinput/igameinput.md)
- [GameInputKeyboardKind](/reference/input/gameinput/enums/gameinputkeyboardkind.md)
