Class KeyInputSystem
Utility class to poll input for key bindings.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Input
Assembly: cs.temp.dll.dll
Syntax
public static class KeyInputSystem
Properties
SimulatingInput
Declaration
public static bool SimulatingInput { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AdvanceSimulation()
Advances the Key press simulation by 1 frame. Keybindings will no longer trigger GetKeyDown(KeyBinding) or GetKeyUp(KeyBinding)
Declaration
public static void AdvanceSimulation()
GetKey(KeyBinding)
Test if the key is currently pressed.
Declaration
public static bool GetKey(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key is currently pressed |
GetKey(KeyBinding)
Test if the key is currently pressed.
Declaration
public static bool GetKey(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key is currently pressed |
GetKeyDown(KeyBinding)
Test if the key has been pressed since the last frame.
Declaration
public static bool GetKeyDown(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key was pressed since the last frame |
GetKeyDown(KeyBinding)
Test if the key has been pressed since the last frame.
Declaration
public static bool GetKeyDown(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key was pressed since the last frame |
GetKeyUp(KeyBinding)
Test if the key has been released since the last frame.
Declaration
public static bool GetKeyUp(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key was released since the last frame |
GetKeyUp(KeyBinding)
Test if the key has been released since the last frame.
Declaration
public static bool GetKeyUp(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
Returns
Type | Description |
---|---|
Boolean | True if the bound key was released since the last frame |
PressKey(KeyBinding)
Presses a key. GetKeyDown(KeyBinding) and GetKey(KeyBinding) will be true for the keybinding. GetKeyUp(KeyBinding) will no longer be true for the keybinding.
Declaration
public static void PressKey(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
ReleaseKey(KeyBinding)
Releases a key. GetKeyUp(KeyBinding) will be true for the keybinding. GetKeyDown(KeyBinding) and GetKey(KeyBinding) will no longer be true for the keybinding.
Declaration
public static void ReleaseKey(KeyBinding kb)
Parameters
Type | Name | Description |
---|---|---|
KeyBinding | kb |
ResetKeyInputSimulation()
Resets the key input simulation. All keys will not trigger GetKeyDown(KeyBinding), GetKey(KeyBinding), or GetKeyUp(KeyBinding)
Declaration
public static void ResetKeyInputSimulation()
StartKeyInputStimulation()
Starts the key input simulation. Inputs can now be simulated via PressKey(KeyBinding) and ReleaseKey(KeyBinding)
Declaration
public static void StartKeyInputStimulation()
StopKeyInputSimulation()
Stops the key input simulation
Declaration
public static void StopKeyInputSimulation()