Class MixedRealityKeyboardBase
Base class for objects that wish to launch and hide a system keyboard specifically for Windows Mixed Reality devices (HoloLens 2, Windows Mixed Reality).
Implements a workaround for UWP TouchScreenKeyboard bug which prevents UWP keyboard from showing up again after it is closed. Unity bug tracking the issue https://fogbugz.unity3d.com/default.asp?1137074_rttdnt8t1lccmtd3
Namespace: Microsoft.MixedReality.Toolkit.Experimental.UI
Assembly: cs.temp.dll.dll
Syntax
public abstract class MixedRealityKeyboardBase : MonoBehaviour
Properties
CaretIndex
Returns the index of the caret within the text.
Declaration
public int CaretIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
OnCommitText
Event which triggers when commit action is invoked on the keyboard. (Usually the return key.)
Declaration
public UnityEvent OnCommitText { get; set; }
Property Value
Type | Description |
---|---|
UnityEvent |
OnHideKeyboard
Event which triggers when the keyboard is hidden.
Declaration
public UnityEvent OnHideKeyboard { get; set; }
Property Value
Type | Description |
---|---|
UnityEvent |
OnShowKeyboard
Event which triggers when the keyboard is shown.
Declaration
public UnityEvent OnShowKeyboard { get; set; }
Property Value
Type | Description |
---|---|
UnityEvent |
Text
Declaration
public abstract string Text { get; protected set; }
Property Value
Type | Description |
---|---|
String |
Visible
Returns true if the keyboard is currently open.
Declaration
public bool Visible { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
ClearKeyboardText()
Removes the current text from the keyboard.
Declaration
public virtual void ClearKeyboardText()
HideKeyboard()
Closes the keyboard for user interaction.
Declaration
public void HideKeyboard()
ShowKeyboard(String, Boolean)
Opens the keyboard for user interaction.
Declaration
public virtual void ShowKeyboard(string text = "", bool multiLine = false)
Parameters
Type | Name | Description |
---|---|---|
String | text | Initial text to populate the keyboard with. |
Boolean | multiLine | True, if the return key should signal a newline rather than a commit. |