Class Keyboard
- Namespace
- SimulationFramework.Input
- Assembly
- SimulationFramework.dll
Provides keyboard input to the simulation.
public static class Keyboard
- Inheritance
-
Keyboard
- Inherited Members
Properties
HeldKeys
Gets a collection of all keys which are held this frame.
public static IEnumerable<Key> HeldKeys { get; }
Property Value
PressedKeys
Gets a collection of all keys pressed this frame. A key is only considered pressed on the first frame that it is held.
public static IEnumerable<Key> PressedKeys { get; }
Property Value
ReleasedKeys
Gets a collection of all keys released this frame. A key is only considered released on the first frame that it is not held.
public static IEnumerable<Key> ReleasedKeys { get; }
Property Value
TypedKeys
All of the characters typed this frame. This is usually used for text input. To check for modifiers, use IsKeyDown(Key).
public static IEnumerable<char> TypedKeys { get; }
Property Value
Methods
IsKeyDown(Key)
Returns true if the provided key is pressed.
public static bool IsKeyDown(Key key)
Parameters
key
Key
Returns
IsKeyPressed(Key)
Returns true if the provided key is pressed this frame and was not pressed the frame before.
public static bool IsKeyPressed(Key key)
Parameters
key
Key
Returns
IsKeyReleased(Key)
Returns true if the provided key is pressed this frame and was not pressed the frame before.
public static bool IsKeyReleased(Key key)
Parameters
key
Key
Returns
Events
KeyPressed
Invoked when a key is pressed on the keyboard.
public static event KeyEvent KeyPressed
Event Type
KeyReleased
Invoked when a key is released on the keyboard.
public static event KeyEvent KeyReleased
Event Type
KeyTyped
Invoked when a key is typed. This is usually used for text input.
public static event KeyTypedEvent KeyTyped