Table of Contents

Class KeyboardDeviceBase

Namespace
Stride.Input
Assembly
Stride.Input.dll

Base class for keyboard devices

public abstract class KeyboardDeviceBase : IKeyboardDevice, IInputDevice
Inheritance
KeyboardDeviceBase
Implements
Derived
Extension Methods

Constructors

KeyboardDeviceBase()

protected KeyboardDeviceBase()

Fields

Events

protected readonly List<KeyEvent> Events

Field Value

List<KeyEvent>

KeyRepeats

public readonly Dictionary<Keys, int> KeyRepeats

Field Value

Dictionary<Keys, int>

Properties

DownKeys

List of keys that are currently down on this keyboard

public IReadOnlySet<Keys> DownKeys { get; }

Property Value

IReadOnlySet<Keys>

Id

The unique identifier of this device

public abstract Guid Id { get; }

Property Value

Guid

Name

The name of the device

public abstract string Name { get; }

Property Value

string

PressedKeys

The keys that have been pressed since the last frame

public IReadOnlySet<Keys> PressedKeys { get; }

Property Value

IReadOnlySet<Keys>

Priority

The device priority. Larger means higher priority when selecting the first device of some type

public int Priority { get; set; }

Property Value

int

ReleasedKeys

The keys that have been released since the last frame

public IReadOnlySet<Keys> ReleasedKeys { get; }

Property Value

IReadOnlySet<Keys>

Source

The input source the device belongs to.

public abstract IInputSource Source { get; }

Property Value

IInputSource

Methods

HandleKeyDown(Keys)

public void HandleKeyDown(Keys key)

Parameters

key Keys

HandleKeyUp(Keys)

public void HandleKeyUp(Keys key)

Parameters

key Keys

Update(List<InputEvent>)

Updates the input device, filling the list inputEvents with input events that were generated by this device this frame

public virtual void Update(List<InputEvent> inputEvents)

Parameters

inputEvents List<InputEvent>

A list that gets filled with input events that were generated since the last frame

Remarks

Input devices are always updated after their respective input source