DisplayOnscreenKeyboard
DocsDisplayOnscreenKeyboard(keyboardType, windowTitle, description, defaultText, defaultConcat1, defaultConcat2, defaultConcat3, maxInputLength)Description
Displays a text input box.
enum eKeyboardType
{
ONSCREEN_KEYBOARD_ENGLISH = 0,
ONSCREEN_KEYBOARD_LOCALISED = 1,
ONSCREEN_KEYBOARD_PASSWORD = 2,
ONSCREEN_KEYBOARD_GAMERTAG = 3,
ONSCREEN_KEYBOARD_EMAIL = 4,
ONSCREEN_KEYBOARD_BASIC_ENGLISH = 5,
ONSCREEN_KEYBOARD_FILENAME = 6
};Parameters
| Name | Type | Description |
|---|---|---|
keyboardType | int | See the list above. Default is `0`. |
windowTitle | char* | Text label for the title of the box. |
description | char* | Has no use on PC. |
defaultText | char* | Default text that is written in the input field. |
defaultConcat1 | char* | — |
defaultConcat2 | char* | — |
defaultConcat3 | char* | — |
maxInputLength | int | Max number of characters that can be typed (2 - 256). |
Returns
voidThis native does not return a value.
Examples
Official
AddTextEntry("my_input_title", "Enter something cool:")
DisplayOnscreenKeyboard(0, "my_input_title", "", "", "", "", "", 30) -- Show the text input box
while UpdateOnscreenKeyboard() == 0 do Wait(0) end -- Wait for the user to stop editing
-- This block of code is reached after the user is done editing
local inputUpdate = UpdateOnscreenKeyboard()
if inputUpdate == 1 then -- User hit OK in the text input box
local result = GetOnscreenKeyboardResult()
print("You wrote this in the input box:", result)
elseif inputUpdate == 2 then
print("You canceled the input!")
else -- -1 or 3
print("An error has occurred")
end