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

# XGameUiShowTextEntryAsync

> XGameUiShowTextEntryAsync

# XGameUiShowTextEntryAsync

Displays a text entry UI for a user to enter information.

## Syntax

```cpp theme={null}
HRESULT XGameUiShowTextEntryAsync(  
         XAsyncBlock* async,  
         const char* titleText,  
         const char* descriptionText,  
         const char* defaultText,  
         XGameUiTextEntryInputScope inputScope,  
         uint32_t maxTextLength  
)  
```

### Parameters

*async*   \_In\_<br />Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

A pointer to the [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) that is passed to [XAsyncRun](/reference/system/xasync/functions/xasyncrun).

*titleText*   \_In\_opt\_z\_<br />Type: char\*

The text title of the text entry UI.

*descriptionText*   \_In\_opt\_z\_<br />Type: char\*

The text description of the text entry UI.

*defaultText*   \_In\_opt\_z\_<br />Type: char\*

Default text that is initially populated in the text entry UI.

*inputScope*   \_In\_<br />Type: [XGameUiTextEntryInputScope](/reference/system/xgameui/enums/xgameuitextentryinputscope)

Specified the input scope of the text entry, indicating the type of information that is allowed. This scope provides a hint as to what text may be desired by the game. The game will still need to validate what text they get back from the keyboard.

*maxTextLength*   \_In\_<br />Type: uint32\_t

The maximum number of characters the user can enter in the text entry UI. On console, the maximum number of characters is 1024. On PC, there is no limitation. If the value 0 is passed in, it will be treated as a maximum character length of 1024. Further, if the *inputScope* is XGameUiTextEntryInputScope::Password, the maximum length will always be 1024 and the *maxTextLength* value will be ignored.

### Return value

Type: HRESULT

HRESULT success or error code of the async call.

To get the result, call [XGameUiShowTextEntryResultSize](/reference/system/xgameui/functions/xgameuishowtextentryresultsize) and [XGameUiShowTextEntryResult](/reference/system/xgameui/functions/xgameuishowtextentryresult) inside the *AsyncBlock* callback or after the *AsyncBlock* is complete.

## Remarks

On consoles, this will provide both a text input field and an onscreen virtual keyboard (OSK). On Windows, this will provide a new window with a text input field. A virtual keyboard will only appear on Windows if the user is configured to use an onscreen keyboard (such as being in tablet mode) rather than using a physical keyboard.

Calling for UI will cause your game to enter *constrained mode*. In constrained mode your title will receive fewer system resources while it is in the background of the UI that has been called for. To learn more about constrained mode and other operational modes for your title read [XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle).

## Requirements

**Header:** XGameUI.h

**Library:** xgameruntime.lib

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

## See also

[XGameUI](/reference/system/xgameui/xgameui_members)<br />[Virtual keyboard support](/build/core-features/common/input/overviews/virtualkeyboardsupport) [XGameUIShowTextEntryResult](/reference/system/xgameui/functions/xgameuishowtextentryresult)<br />[XGameUIShowTextEntryResultSize](/reference/system/xgameui/functions/xgameuishowtextentryresultsize)<br />[XBOX Game Life Cycle (NDA topic)](/build/console-features/console-workflows/xbox-game-life-cycle)


## Related topics

- [XGameUiShowTextEntryResult](/reference/system/xgameui/functions/xgameuishowtextentryresult.md)
- [XGameUiShowTextEntryResultSize](/reference/system/xgameui/functions/xgameuishowtextentryresultsize.md)
- [XGameUiShowTextEntryUiCallback](/reference/system/xgameui/functions/xgameuishowtextentryuicallback.md)
- [XGameUiSetTextEntryUiResponse](/reference/system/xgameui/functions/xgameuisettextentryuiresponse.md)
- [XGameUiTextEntryInputScope](/reference/system/xgameui/enums/xgameuitextentryinputscope.md)
