class MAGES::UIs::VRKeyboardController

Overview

A tool to spawn and manage VR Keyboard with useful functions to retrieve input from the VRKeyboard. Use: 1) Initialize the Keyboard using initialize(). 2) Give the keyboard the existing string you want to manipulate, if any, using InitializeInputBuffer(string inputBuffer). 3) Use the SetSubmitText(string text) to modify the enter button’s text according to the application’s needs (optional). 3) Attach CallBack Actions if wanted and not done in inspector (optional). 4) Use the GetInputBuffer to get the Updated input (is not mandatory to be called every frame. The keyboard saves the string internally). More…

class VRKeyboardController: public MonoBehaviour
{
public:
    // properties

    List<KeyLayout> KeyLayouts;
    Keys ButtonTextFields;
    UnityEvent OnSubmit;
    UnityEvent OnTab;
    UnityEvent OnAnyTextKey;
    UnityEvent OnAnyKey;

    // methods

    bool Initialize();
    void InitializeInputBuffer(string inputBuffer);
    void SetInputBuffer(string inputBuffer);
    void SetCaretPosition(int position);
    void IncrementCaretPosition();
    void DecrementCaretPostion();
    int GetCaretPosition();
    string GetInputBuffer();
    bool EnableLayoutChange(bool enabled);
    void SetLayout(int savedLayoutsIndex);
    void SetLayout(KeyLayout layout);
    void NextLayout();
    void RefreshLayout();
    void SetSubmitText(string text);
    void Reset();
    void R1K1_OnClick();
    void R1K2_OnClick();
    void R1K3_OnClick();
    void R1K4_OnClick();
    void R1K5_OnClick();
    void R1K6_OnClick();
    void R1K7_OnClick();
    void R1K8_OnClick();
    void R1K9_OnClick();
    void R1K10_OnClick();
    void R2K1_OnClick();
    void R2K2_OnClick();
    void R2K3_OnClick();
    void R2K4_OnClick();
    void R2K5_OnClick();
    void R2K6_OnClick();
    void R2K7_OnClick();
    void R2K8_OnClick();
    void R2K9_OnClick();
    void R2K10_OnClick();
    void R3K1_OnClick();
    void R3K2_OnClick();
    void R3K3_OnClick();
    void R3K4_OnClick();
    void R3K5_OnClick();
    void R3K6_OnClick();
    void R3K7_OnClick();
    void R3K8_OnClick();
    void R3K9_OnClick();
    void R3K10_OnClick();
    void R4K1_OnClick();
    void R4K2_OnClick();
    void R4K3_OnClick();
    void R4K4_OnClick();
    void R4K5_OnClick();
    void R4K6_OnClick();
    void R4K7_OnClick();
    void R4K8_OnClick();
    void R4K9_OnClick();
    void R5K1_OnClick();
    void R5K2_OnClick();
    void R5K3_OnClick();
    void R5K4_OnClick();
    void R5K5_OnClick();
};

Detailed Documentation

A tool to spawn and manage VR Keyboard with useful functions to retrieve input from the VRKeyboard. Use: 1) Initialize the Keyboard using initialize(). 2) Give the keyboard the existing string you want to manipulate, if any, using InitializeInputBuffer(string inputBuffer). 3) Use the SetSubmitText(string text) to modify the enter button’s text according to the application’s needs (optional). 3) Attach CallBack Actions if wanted and not done in inspector (optional). 4) Use the GetInputBuffer to get the Updated input (is not mandatory to be called every frame. The keyboard saves the string internally).

Properties

List<KeyLayout> KeyLayouts

Gets or Sets the list of Layouts to Cycle through when the Layout Change Button is used.

Keys ButtonTextFields

Gets or Sets the keys’ Textfields.

UnityEvent OnSubmit

Gets or Sets the Unity Event invoked when the Submit(Enter) key of the VRKeyboard is released.

UnityEvent OnTab

Gets or Sets the Unity Event invoked when the Tab Key is released. Attaching Listeners will override the default behaviour of Tab.

UnityEvent OnAnyTextKey

Gets or Sets the Unity Event invoked when any text manipulation key of the VRKeyboard is released. For tab it is only called when the default behaviour of it has not been changed.

UnityEvent OnAnyKey

Gets or Sets the Unity Event invoked when any key of the VRKeyboard is released.

Methods

bool Initialize()

Initialize the Keyboard with the layout in 0 position.

Returns:

True on initialization success.

void InitializeInputBuffer(string inputBuffer)

Sets the input buffer and moves the Caret to the last position.

Parameters:

inputBuffer

The input buffer.

void SetInputBuffer(string inputBuffer)

Sets the input buffer and clamps the Caret to the new length of it.

Parameters:

inputBuffer

The input buffer.

void SetCaretPosition(int position)

Moves the Caret.

Parameters:

position

The new Caret position.

void IncrementCaretPosition()

Increments Caret position by 1 always clamping it to the length of the input buffer.

void DecrementCaretPostion()

Decrements Caret position by 1 always clamping it to the length of the input buffer.

int GetCaretPosition()

Gets the current Caret position.

Returns:

The current Caret position.

string GetInputBuffer()

Returns the input buffer as changed by the input of the user.

Returns:

The changed input buffer.

bool EnableLayoutChange(bool enabled)

Enables/Disables the layout/language change button on the keyboard.

Parameters:

enabled

true to enable, false to disable.

Returns:

True if the layout is changed.

void SetLayout(int savedLayoutsIndex)

Sets a layout from the saved layouts.

Parameters:

savedLayoutsIndex

The position of the layout in the Layout List.

void SetLayout(KeyLayout layout)

Sets a custom layout not saved in the Layout List.

Parameters:

layout

The custom layout.

void NextLayout()

Loops through the layouts of the Layout List.

void RefreshLayout()

Refreshes the keyboard Layout Display.

void SetSubmitText(string text)

Sets custom text for the submit(enter) button of the keyboard.

Parameters:

text

The custom text.

void Reset()

Resets the key fields of the keyboard.

void R1K1_OnClick()

R1K1 on click function.

void R1K2_OnClick()

R1K1 on click function.

void R1K3_OnClick()

R1K1 on click function.

void R1K4_OnClick()

R1K1 on click function.

void R1K5_OnClick()

R1K1 on click function.

void R1K6_OnClick()

R1K1 on click function.

void R1K7_OnClick()

R1K1 on click function.

void R1K8_OnClick()

R1K1 on click function.

void R1K9_OnClick()

R1K1 on click function.

void R1K10_OnClick()

R1K1 on click function.

void R2K1_OnClick()

R1K1 on click function.

void R2K2_OnClick()

R1K1 on click function.

void R2K3_OnClick()

R1K1 on click function.

void R2K4_OnClick()

R1K1 on click function.

void R2K5_OnClick()

R1K1 on click function.

void R2K6_OnClick()

R1K1 on click function.

void R2K7_OnClick()

R1K1 on click function.

void R2K8_OnClick()

R1K1 on click function.

void R2K9_OnClick()

R1K1 on click function.

void R2K10_OnClick()

R1K1 on click function.

void R3K1_OnClick()

R1K1 on click function.

void R3K2_OnClick()

R1K1 on click function.

void R3K3_OnClick()

R1K1 on click function.

void R3K4_OnClick()

R1K1 on click function.

void R3K5_OnClick()

R1K1 on click function.

void R3K6_OnClick()

R1K1 on click function.

void R3K7_OnClick()

R1K1 on click function.

void R3K8_OnClick()

R1K1 on click function.

void R3K9_OnClick()

R1K1 on click function.

void R3K10_OnClick()

R1K1 on click function.

void R4K1_OnClick()

R1K1 on click function.

void R4K2_OnClick()

R1K1 on click function.

void R4K3_OnClick()

R1K1 on click function.

void R4K4_OnClick()

R1K1 on click function.

void R4K5_OnClick()

R1K1 on click function.

void R4K6_OnClick()

R1K1 on click function.

void R4K7_OnClick()

R1K1 on click function.

void R4K8_OnClick()

R1K1 on click function.

void R4K9_OnClick()

R1K1 on click function.

void R5K1_OnClick()

R1K1 on click function.

void R5K2_OnClick()

R1K1 on click function.

void R5K3_OnClick()

R1K1 on click function.

void R5K4_OnClick()

R1K1 on click function.

void R5K5_OnClick()

R1K1 on click function.