Class KeyboardDeviceBase
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
KeyRepeats
public readonly Dictionary<Keys, int> KeyRepeats
Field Value
Properties
DownKeys
List of keys that are currently down on this keyboard
public IReadOnlySet<Keys> DownKeys { get; }
Property Value
Id
The unique identifier of this device
public abstract Guid Id { get; }
Property Value
Name
The name of the device
public abstract string Name { get; }
Property Value
PressedKeys
The keys that have been pressed since the last frame
public IReadOnlySet<Keys> PressedKeys { get; }
Property Value
Priority
The device priority. Larger means higher priority when selecting the first device of some type
public int Priority { get; set; }
Property Value
ReleasedKeys
The keys that have been released since the last frame
public IReadOnlySet<Keys> ReleasedKeys { get; }
Property Value
Source
The input source the device belongs to.
public abstract IInputSource Source { get; }
Property Value
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