Skip to main content

InputFieldWithKeyboard

A class in Root.Township, Alta.Meta.UI.

Client: connects a UI InputField to the in-world VR TouchScreenKeyboard, showing it at a marker and passing typed text back.

Constructors​

MemberWhat it is
InputFieldWithKeyboard()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

12 private and internal fields
MemberWhat it is
private Object autoCompletionSourceBacking field for AutoCompletionSource, set in the inspector.
private bool btnKeyboardInspector button that calls ShowKeyboard.
private Transform caretOptional caret object shown while typing.
private bool hideOnSubmitWhether submitting closes the keyboard (default true).
private InputField inputFieldBacking field for InputField.
private bool isChildingKeyboardToPositionMarkerWhether the keyboard is parented to keyboardPosition so it moves with it.
private bool isPasswordKeyboardWhether the keyboard shows its show/hide secret key.
private TouchScreenKeyboard keyboardBacking field for Keyboard.
private Transform keyboardPositionWhere the keyboard appears.
private TouchScreenKeyboard keyboardPrefabKeyboard prefab spawned if no TouchScreenKeyboard.Instance exists yet.
private int maxCharactersLimitBacking field for MaxCharactersLimit.
private bool showKeyboardOnAwakeWhether to open the keyboard as soon as the object wakes.

Properties​

MemberWhat it is
InputField InputField { get; }The input field this keyboard types into.
TouchScreenKeyboard Keyboard { get; }The keyboard currently open for this field, or null.
int MaxCharactersLimit { get; }Maximum characters allowed, or -1 for no limit.
1 private and internal property
MemberWhat it is
private IAutoCompletionSource AutoCompletionSource { get; }The optional auto completion source given to the keyboard when it opens.

Methods​

MemberWhat it is
void HandleKeyboardInput(string input)Called by the keyboard with the typed text; sets it on the input field.
void HandleKeyboardSubmit()Called by the keyboard on submit; submits the input field and hides the keyboard if hideOnSubmit is set.
void HideKeyboard()Hides the keyboard for this user, turns off the caret and unhooks the secret toggle.
bool IsShowingSecret()Whether the input field is currently hiding its text (password mode).
void ShowKeyboard()Opens the keyboard, optionally on a given keyboard layout index, and applies the auto completion source.
void ShowKeyboard(int targetKeyboard)Opens the keyboard, optionally on a given keyboard layout index, and applies the auto completion source.
6 private and internal methods
MemberWhat it is
private void Awake()Opens the keyboard straight away if showKeyboardOnAwake is set.
private void InternalShow()Spawns the keyboard prefab if none exists, places it at keyboardPosition, and sets up input, secret key and caret.
private void IUseVirtualKeyboard.LostFocus()Keyboard interface callback; does nothing here.
private void IUseVirtualKeyboard.Next()Keyboard interface callback; does nothing here.
private void OnDisable()Hides the keyboard when the object is disabled.
private void IUseVirtualKeyboard.Previous()Keyboard interface callback; does nothing here.

Used in​

Members of other types that take, return or hold a InputFieldWithKeyboard: