Keyboard ClassDelta Engine Documentation
Provides a way to fetch the current input values from a Keyboard device (virtual or real). View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities UpdateBehavior
    DeltaEngine.Input InputDevice
      DeltaEngine.Input Keyboard
        DeltaEngine.Input.GLFW2 GLFWKeyboard
        DeltaEngine.Input.GLFW3 GLFWKeyboard
        DeltaEngine.Input.Mocks MockKeyboard
        DeltaEngine.Input.SharpDX SharpDXKeyboard
        DeltaEngine.Input.SlimDX SlimDXKeyboard
        DeltaEngine.Input.Windows WindowsKeyboard
        DeltaEngine.Input.Xna XnaKeyboard

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

public abstract class Keyboard : InputDevice

The Keyboard type exposes the following members.

Constructors

  NameDescription
Protected methodKeyboard
Initializes a new instance of the Keyboard class
Top
Methods

  NameDescription
Public methodDispose (Inherited from InputDevice.)
Public methodGetKeyState
Public methodHandleInput
Public methodUpdate (Overrides UpdateBehavior Update(IEnumerable Entity ).)
Protected methodUpdateKeyStates
Top
Fields

  NameDescription
Protected fieldkeyboardStates
Protected fieldnewlyPressedKeys
Top
Properties

  NameDescription
Public propertyIsAvailable (Overrides InputDevice IsAvailable.)
Protected propertyIsCapsLocked
Top
Remarks

Tests: DeltaEngine.Input.Tests.KeyboardMessagesTests
Examples

16 unit tests call DeltaEngine.Input.Keyboard
[Test]
public void CanCreateKeyboardMessageWithoutParameter()
{
    keyboardMessage = new KeyboardMessage();
    Assert.NotNull(keyboardMessage);
}
[Test]
public void PressedKeyShouldBeEnter()
{
    Assert.AreEqual(new[] { Key.Enter }, keyboardMessage.PressedKeys);
}
[TestFixtureTearDown]
public void Dispose()
{
    keyboard.Dispose();
}
See Also