Table of Contents

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

IEnumerable<Key>

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

IEnumerable<Key>

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

IEnumerable<Key>

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

IEnumerable<char>

Methods

IsKeyDown(Key)

Returns true if the provided key is pressed.

public static bool IsKeyDown(Key key)

Parameters

key Key

Returns

bool

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

bool

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

bool

Events

KeyPressed

Invoked when a key is pressed on the keyboard.

public static event KeyEvent KeyPressed

Event Type

KeyEvent

KeyReleased

Invoked when a key is released on the keyboard.

public static event KeyEvent KeyReleased

Event Type

KeyEvent

KeyTyped

Invoked when a key is typed. This is usually used for text input.

public static event KeyTypedEvent KeyTyped

Event Type

KeyTypedEvent