WindowsKeyboard ClassDelta Engine Documentation
Native keyboard implementation using a windows hook. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities UpdateBehavior
    DeltaEngine.Input InputDevice
      DeltaEngine.Input Keyboard
        DeltaEngine.Input.Windows WindowsKeyboard

Namespace: DeltaEngine.Input.Windows
Assembly: DeltaEngine.Input.Windows (in DeltaEngine.Input.Windows.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class WindowsKeyboard : Keyboard

The WindowsKeyboard type exposes the following members.

Constructors

  NameDescription
Public methodWindowsKeyboard
Initializes a new instance of the WindowsKeyboard class
Top
Methods

  NameDescription
Public methodDispose (Overrides InputDevice Dispose .)
Public methodGetKeyState (Inherited from Keyboard.)
Public methodHandleInput (Inherited from Keyboard.)
Public methodUpdate (Inherited from Keyboard.)
Protected methodUpdateKeyStates (Overrides Keyboard UpdateKeyStates .)
Top
Fields

  NameDescription
Protected fieldkeyboardStates (Inherited from Keyboard.)
Protected fieldnewlyPressedKeys (Inherited from Keyboard.)
Protected fieldpressedKeys
Protected fieldreleasedKeys
Top
Properties

  NameDescription
Public propertyIsAvailable (Inherited from Keyboard.)
Protected propertyIsCapsLocked (Overrides Keyboard IsCapsLocked.)
Top
Remarks

Tests: DeltaEngine.Input.Windows.Tests.WindowsKeyboardTests
Examples

3 unit tests call DeltaEngine.Input.Windows.WindowsKeyboard
[Test, CloseAfterFirstFrame]
public void UpdateKeyboard()
{
    var trigger = new KeyTrigger(Key.A);
    keyboard.Update(new[]{trigger});
[Test, CloseAfterFirstFrame]
public void DisposeSetsUnavailable()
{
    keyboard.Dispose();
    Assert.IsFalse(keyboard.IsAvailable);
}
[Test, CloseAfterFirstFrame]
public void UpdateKeyStates()
{
    var mockKeyboard = new MockWindowsKeyboard();
    mockKeyboard.SetPressedKey(Key.A);
    var triggerPressing = new KeyTrigger(Key.A);
    mockKeyboard.Update(new[] { triggerPressing });
See Also