Virtual Keyboard
This addon provides a virtual alpha-numeric keyboard with upper and lower case as well as special characters. It can works offline.
KeyboardFocusManager
KeyboardFocusManager
is in charge to manage keyboard focus requests from objects in the scene.
Objects that needs a keyboard must implement the ITextFocusable
interface.
They can request the focus with OnFocusChange()
or inform the KeyboardFocusManager
that text has changed with OnTextChange()
(input field can be updated by real keyboard).
KeyboardFocusManager
updates the keyboard position & buffer when a new object get the focus.
Also, the current KeyboardFocus
object is informed when the keyboard buffer changed or when the focus is lost thanks to the KeyboardManager
callbacks.
The keyboard position can be adjusted in relation to the player's rig position.
Also, the moveKeyboardOnFocusChange
allows the keyboard position to be updated (or not) each time the user selects another input field.
TouchableTMPInputField
This class is implemented in the CanvasUITouchableTMPInputField
prefab that can be used with the TouchableCanvas
.
TouchableTMPInputField
manages 3D interaction with TextMeshPro input field (TMP_InputField
).
To do so, a BoxCollider
and a touchable
are required on the game object. The size of the BoxCollider
is changed to the size of the input field to generate a corresponding 3D button collider.
When the player touches the box collider, the OnTouch
event of the Touchable
class is detected.
Then the keyboard visibility is toggled and the KeyboardFocusManager
is informed that the focus changed.
KeyboardFocusManager
is also informed when the text field is updated.
Dependencies
- TouchHover addon
Demo
A demo scene can be found in the Assets\Photon\FusionAddons\VirtualKeyboard\Demo\Scenes\
folder.
Download
This addon latest version is included into the Industries addon project
Supported topologies
- shared mode
Changelog
- Version 2.0.2:
- Fix to avoid double onTextChange event
- Add toggleFocusOnTouch & canReceiveFocus options
- Handle TouchableTMPInputField input field selection state based on focus
- Fix box collider trigger option on the CanvasUITouchableTMPInputField prefab
- Version 2.0.1: Remove dependency in Demo prefab
- Version 2.0.0: First release