Skip to main content

KeyboardInfo

Namespace: MonineEngine.Input

public class KeyboardInfo

Inheritance ObjectKeyboardInfo

Properties

PreviousState

The state of the keyboard input during the previous update cycle.

public KeyboardState PreviousState { get; private set; }

Property Value

KeyboardState

CurrentState

The state of the keyboard input during the current update cycle.

public KeyboardState CurrentState { get; private set; }

Property Value

KeyboardState

Constructors

KeyboardInfo()

Constructs a new KeyboardInfo.

public KeyboardInfo()

Methods

Update()

Updates the state information about keyboard input.

public void Update()

IsKeyDown(Keys)

Checks if the specified key is currently down.

public bool IsKeyDown(Keys key)

Parameters

key Keys
The key to check.

Returns

Boolean
If the specified key is currently down, returns true. Otherwise, returns false.

IsKeyUp(Keys)

Checks if the specified key is currently up.

public bool IsKeyUp(Keys key)

Parameters

key Keys
The key to check.

Returns

Boolean
If the specified key is currently up, returns true. Otherwise, returns false.

WasKeyPressed(Keys)

Checks if the specified key was just pressed on the current frame.

public bool WasKeyPressed(Keys key)

Parameters

key Keys
The key to check.

Returns

Boolean
If the specified key was just pressed on the current frame, returns true. Otherwise, false.

WasKeyReleased(Keys)

Checks if the specified key was just released on the current frame.

public bool WasKeyReleased(Keys key)

Parameters

key Keys
The key to check.

Returns

Boolean
If the specified key was just released on the current frame, returns true. Otherwise, false.