-
-
Notifications
You must be signed in to change notification settings - Fork 2
World Space Keyboard
class in ExPresSXR.UI / Extends MonoBehaviour
GameObject instantiable via ExPresS XRKeyboard - ...
A world space UI element representing keyboard with an input field for XR. It can be configured to match any set of characters or even longer string sequences. Keyboards of the German and English key layouts, and a numpad can be created directly from the GameObject-Menu.
The keyboard can have a Caps-key which is interpreted determined by capsMode
.
It can either be:
- Toggle: Pressing Caps will change between upper to lower and keep it until pressed again.
- OneCharUpper: Pressing Caps will change the next character to upper, then go back to lower
- AlwaysUpper: The caps does not have an effect. All characters are in upper case.
- AlwaysLower: The caps does not have an effect. All characters are in lower case.
To make a new custom Keyboard create a Canvas Object and add a WorldSpaceKeyboards
-Component.
Then place all Buttons and connect the Buttons with their OnPressed
-Event with
the WorldSpaceKeyboard.appendToText()
-function passing the text of the button as parameter.
For the deletion of the last character, clearing or confirming the text simply connect their respective functions instead.
If the current text should be shown, add a TMP_InputField
and drag it into the property of the WorldSpaceKeyboards
.
-
TMP_InputField _inputField
: A reference to theTMP_InputField
used to show the already input characters. -
Button _capsButton
: A reference to theUnityEngine.UI.Button
that toggles thecapsActive
.
-
string inputText
: The currently input text. -
CapsMode capsMode
: The mode of how caps is interpreted -
bool capsActive
: If enabled added characters will be interpreted according tocapsMode
.
-
void ConfirmText()
: Can be used to emitOnTextEntered
with the currently enteredinputText
. -
void AppendToText(string stringToAppend)
: Appends another string (or character) to theinputText
. -
void RemoveLastFromText()
: Removes the last character from theinputText
. -
void ClearText()
: Clears all characters from theinputText
.
-
UnityEvent<string> OnTextEntered
: Emitted when the inputinputText
should be confirmed. -
UnityEvent<string> OnTextChanged
: Emitted when a new character/string is added or removed toinputText
.
-
CapsMode
: Denotes how the caps key is interpreted.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI