CellexalVR  1.1.0
A virtual reality platform for the exploration and analysis of single-cell gene expression data
CellexalVR.Interaction.KeyboardHandler Class Reference

Handles the keyboard and what happens when keys are pressed. More...

Inheritance diagram for CellexalVR.Interaction.KeyboardHandler:
CellexalVR.Interaction.FilterNameKeyboardHandler CellexalVR.Interaction.FolderKeyboardHandler CellexalVR.Interaction.GeneKeyboardHandler CellexalVR.Interaction.NumericalKeyboardHandler CellexalVR.Interaction.OperatorKeyboardHandler CellexalVR.Interaction.ReferenceModelKeyboard CellexalVR.Interaction.WebKeyboardHandler

Public Member Functions

virtual void Shift ()
 
virtual void NumChar ()
 
Vector4 ScaleCorrection ()
 Gets the scale correction for the keyboard shader. More...
 
IEnumerator ShowMessage (string message, float time=5f)
 Shows a message for a certain time or if the user starts typing again. Called if something went wrong or anything to inform the user. 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 ()
 Starts a pulse at the current laser coordinates, set by UpdateLaserCoords(Vector2). 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)
 
void SetAllOutputs (string text, Definitions.Measurement type)
 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...
 

Public Attributes

ReferenceManager referenceManager
 
GameObject keysParentObject
 
TextMeshPro output
 
List< TextMeshPro > additionalOutputs
 
float height = 5f
 
float anglePerUnit = 5f
 
float distance = 8f
 
string placeholder = "Enter a name"
 
bool clearOnEnter = true
 
KeyboardEvent OnEdit
 
KeyboardEvent OnEditMultiuser
 
KeyboardEvent OnEnter
 
KeyboardEvent OnAnnotate
 
Vector2 minPos
 
Vector2 maxPos
 
List< Material > materials
 

Protected Member Functions

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...
 

Protected Attributes

KeyboardPanel[] sortedKeys
 
string prefabFolderPath = Path.Combine("Assets", "Prefabs", "Keyboards")
 
string prefabPath
 

Properties

int CurrentLayout [get, protected set]
 
abstract string[][] Layouts [get, protected set]
 

Detailed Description

Handles the keyboard and what happens when keys are pressed.

Member Function Documentation

◆ AddText()

void CellexalVR.Interaction.KeyboardHandler.AddText ( string  add,
bool  invokeMultiuserEvent 
)

Adds text to the output.

Parameters
addText to add

◆ BackSpace()

void CellexalVR.Interaction.KeyboardHandler.BackSpace ( bool  invokeMultiuserEvent = false)

Removes the last typed letter.

◆ Clear() [1/2]

void CellexalVR.Interaction.KeyboardHandler.Clear ( )

Clears the output.

◆ Clear() [2/2]

void CellexalVR.Interaction.KeyboardHandler.Clear ( bool  invokeMultiuserEvent = false)

Clears the output.

Parameters
invokeMultiuserEventTrue if an event to run this function on all connected clients should be invoked.

◆ 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.

◆ Pulse()

void CellexalVR.Interaction.KeyboardHandler.Pulse ( )

Starts a pulse at the current laser coordinates, set by UpdateLaserCoords(Vector2).

◆ 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,
Definitions.Measurement  type 
)

Sets all outputs to a text.

Parameters
textThe 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).

◆ ShowMessage()

IEnumerator CellexalVR.Interaction.KeyboardHandler.ShowMessage ( string  message,
float  time = 5f 
)

Shows a message for a certain time or if the user starts typing again. Called if something went wrong or anything to inform the user.

◆ 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
layoutThe new layout.

◆ 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
dirA 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
posThe uv2 coordinates of the laser hit.

The documentation for this class was generated from the following file: