Virtual keyboard support
While a physically attached keyboard is common on desktop PC, they are rare on console and when cloud streaming to another console or mobile device. As text entry can be critical to a game, the GDK provides two different solutions to handle text input using a virtual keyboard. For most games, the best solutions is to rely on XGameUiShowTextEntryAsync. For games that need to render multi-line text or the input of more than 1024 characters, they can rely on XGameUiTextEntryOpen.
The following table provides a comparison between these two solutions.
Description | XGameUiShowTextEntryAsync | XGameUiTextEntryOpen |
---|---|---|
Multi-line support | No | Yes |
Maximum number of characters | 1024 | 1024 * 32 |
Input focus | Virtual keyboard gets input focus | Virtual keyboard gets input focus |
Positioning | Fixed position | Positional by the game |
Text rendering | Handled by the virtual keyboard | Handled by the game |
Cloud streaming behavior | Leverage the virtual keyboard on the client | Rendered by streaming server |