Handles the keyboard and what happens when keys are pressed.
More...
|
virtual void | Shift () |
|
virtual void | NumChar () |
|
Vector4 | ScaleCorrection () |
| Gets the scale correction for the keyboard shader. More...
|
|
void | SetMaterials (Material keyNormalMaterial, Material keyHighlightMaterial, Material keyPressedMaterial) |
| Sets the materials on all keys. See ClickablePanel.SetMaterials(Material, Material, Material). More...
|
|
void | AddMaterials (params Material[] mats) |
|
void | Pulse (Vector2 pos) |
| Displays a pulse. More...
|
|
virtual void | UpdateLaserCoords (Vector2 pos) |
| Updates the coordinates for the laser hit animation. More...
|
|
void | AddText (string add, bool invokeMultiuserEvent) |
| Adds text to the output. More...
|
|
void | BackSpace (bool invokeMultiuserEvent=false) |
| Removes the last typed letter. More...
|
|
void | Clear () |
| Clears the output. More...
|
|
void | Clear (bool invokeMultiuserEvent=false) |
| Clears the output. More...
|
|
void | SubmitOutput (bool invoke=true) |
| Colors all graphs based on what was typed. More...
|
|
string | Text () |
| Returns the currently typed text. More...
|
|
void | DismissKeyboard () |
| Clears all outputs and disables this keyboard. More...
|
|
void | SetAllOutputs (string text) |
| Sets all outputs to a text. More...
|
|
Vector2 | ToUv2Coord (Vector3 dir) |
| Converts a direction to a uv2 coordinate on the keyboard. This function can return uv2 coordinates that are not actually on the keyboard if there is no keyboard in that direction. More...
|
|
virtual bool | BuildKeyboard (KeyboardHandler prefab) |
| Builds the keyboard by creating the meshes and positioning everything. More...
|
|
Mesh | CreateNineSlicedQuad (Vector2 uv2min, Vector2 uv2max, Vector2 size, float anglePerUnit, Vector2 keyboardSize) |
| Creates a nine sliced quad that is used for the panels on the keyboard. This lets us use a texture with a border that won't be stretched over non-square panels. Meshes will be curved along a circle arc with the angle anglePerUnit multiplied by the x component of size and with the radius distance . More...
|
|
|
virtual void | Start () |
|
virtual IEnumerator | PulseCoroutine () |
| Uses the Keyboard shader to play a pulse anmimation. More...
|
|
void | SetVectors (string name, Vector4 value) |
|
void | SetFloats (string name, float value) |
|
void | GatherKeys () |
|
bool | GatherKeys (KeyboardHandler prefabInstance) |
| Gathers the keys from the scene. More...
|
|
void | SwitchLayout (string[] layout) |
| Switches the layout of the keyboard. More...
|
|
void | OpenPrefab< T > (out GameObject outerMostPrefab, out T scriptOnPrefab) |
| Helper method for inherited classes to open the correct prefab. Remember to call ClosePrefab(GameObject) after. More...
|
|
void | ClosePrefab (GameObject prefab) |
| Helper method for inherited clases to close the correct prefab. More...
|
|
|
KeyboardPanel[] | sortedKeys |
|
string | prefabFolderPath = "Assets/Prefabs/Keyboards" |
|
string | prefabPath |
|
|
int | CurrentLayout [get, protected set] |
|
abstract string[][] | Layouts [get, protected set] |
|
Handles the keyboard and what happens when keys are pressed.
◆ AddText()
void CellexalVR.Interaction.KeyboardHandler.AddText |
( |
string |
add, |
|
|
bool |
invokeMultiuserEvent |
|
) |
| |
Adds text to the output.
- Parameters
-
◆ BackSpace()
void CellexalVR.Interaction.KeyboardHandler.BackSpace |
( |
bool |
invokeMultiuserEvent = false | ) |
|
Removes the last typed letter.
◆ BuildKeyboard()
virtual bool CellexalVR.Interaction.KeyboardHandler.BuildKeyboard |
( |
KeyboardHandler |
prefab | ) |
|
|
virtual |
Builds the keyboard by creating the meshes and positioning everything.
- Returns
- True if the keyboard was successfully built, false otherwise.
◆ Clear() [1/2]
void CellexalVR.Interaction.KeyboardHandler.Clear |
( |
| ) |
|
◆ Clear() [2/2]
void CellexalVR.Interaction.KeyboardHandler.Clear |
( |
bool |
invokeMultiuserEvent = false | ) |
|
Clears the output.
- Parameters
-
invokeMultiuserEvent | True if an event to run this function on all connected clients should be invoked. |
◆ ClosePrefab()
void CellexalVR.Interaction.KeyboardHandler.ClosePrefab |
( |
GameObject |
prefab | ) |
|
|
protected |
Helper method for inherited clases to close the correct prefab.
- Parameters
-
◆ CreateNineSlicedQuad()
Mesh CellexalVR.Interaction.KeyboardHandler.CreateNineSlicedQuad |
( |
Vector2 |
uv2min, |
|
|
Vector2 |
uv2max, |
|
|
Vector2 |
size, |
|
|
float |
anglePerUnit, |
|
|
Vector2 |
keyboardSize |
|
) |
| |
Creates a nine sliced quad that is used for the panels on the keyboard. This lets us use a texture with a border that won't be stretched over non-square panels. Meshes will be curved along a circle arc with the angle anglePerUnit multiplied by the x component of size and with the radius distance .
- Parameters
-
uv2min | The smallest uv2 coordinates. The uv2 should reflect the panel's position on the keyboard. |
uv2max | The largest uv2 coordinates. |
size | This panel's size. |
anglePerUnit | Radians per unit of size . Affects how wide the panel becomes. |
keyboardSize | The size of the keyboard, in the same units as size . |
- Returns
◆ DismissKeyboard()
void CellexalVR.Interaction.KeyboardHandler.DismissKeyboard |
( |
| ) |
|
Clears all outputs and disables this keyboard.
◆ GatherKeys()
bool CellexalVR.Interaction.KeyboardHandler.GatherKeys |
( |
KeyboardHandler |
prefabInstance | ) |
|
|
protected |
Gathers the keys from the scene.
- Returns
- True if keys were succesfully gathered, false otherwise.
◆ OpenPrefab< T >()
void CellexalVR.Interaction.KeyboardHandler.OpenPrefab< T > |
( |
out GameObject |
outerMostPrefab, |
|
|
out T |
scriptOnPrefab |
|
) |
| |
|
protected |
Helper method for inherited classes to open the correct prefab. Remember to call ClosePrefab(GameObject) after.
- Parameters
-
prefab | The opened prefab. |
scriptOnPrefab | This script, but on the prefab. |
◆ Pulse()
void CellexalVR.Interaction.KeyboardHandler.Pulse |
( |
Vector2 |
pos | ) |
|
Displays a pulse.
- Parameters
-
pos | The uv2 coordinates of the center of the pulse. |
◆ PulseCoroutine()
virtual IEnumerator CellexalVR.Interaction.KeyboardHandler.PulseCoroutine |
( |
| ) |
|
|
protectedvirtual |
Uses the Keyboard shader to play a pulse anmimation.
◆ ScaleCorrection()
Vector4 CellexalVR.Interaction.KeyboardHandler.ScaleCorrection |
( |
| ) |
|
Gets the scale correction for the keyboard shader.
◆ SetAllOutputs()
void CellexalVR.Interaction.KeyboardHandler.SetAllOutputs |
( |
string |
text | ) |
|
Sets all outputs to a text.
- Parameters
-
text | The text to set all outputs to |
◆ SetMaterials()
void CellexalVR.Interaction.KeyboardHandler.SetMaterials |
( |
Material |
keyNormalMaterial, |
|
|
Material |
keyHighlightMaterial, |
|
|
Material |
keyPressedMaterial |
|
) |
| |
Sets the materials on all keys. See ClickablePanel.SetMaterials(Material, Material, Material).
◆ SubmitOutput()
void CellexalVR.Interaction.KeyboardHandler.SubmitOutput |
( |
bool |
invoke = true | ) |
|
Colors all graphs based on what was typed.
◆ SwitchLayout()
void CellexalVR.Interaction.KeyboardHandler.SwitchLayout |
( |
string[] |
layout | ) |
|
|
protected |
Switches the layout of the keyboard.
- Parameters
-
◆ Text()
string CellexalVR.Interaction.KeyboardHandler.Text |
( |
| ) |
|
Returns the currently typed text.
◆ ToUv2Coord()
Vector2 CellexalVR.Interaction.KeyboardHandler.ToUv2Coord |
( |
Vector3 |
dir | ) |
|
Converts a direction to a uv2 coordinate on the keyboard. This function can return uv2 coordinates that are not actually on the keyboard if there is no keyboard in that direction.
- Parameters
-
dir | A direction starting from the keyboard's local (0, 0, 0) position, preferably pointing towards the keyboard. |
- Returns
- A uv2 coordinate where the dir points to.
◆ UpdateLaserCoords()
virtual void CellexalVR.Interaction.KeyboardHandler.UpdateLaserCoords |
( |
Vector2 |
pos | ) |
|
|
virtual |
Updates the coordinates for the laser hit animation.
- Parameters
-
pos | The uv2 coordinates of the laser hit. |
The documentation for this class was generated from the following file:
- Assets/Scripts/Interaction/KeyboardHandler.cs