State EnumerationDelta Engine Documentation
All states a mouse button, keyboard key, touch, gamepad or gesture may have. View code on GitHub

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

public enum State
Members

  Member nameValueDescription
Released0 Default state for any button, key or gesture, no input is happening, no event will be fired View code on GitHub
Releasing1 This state will be set when the key or button is released again, which can happen in the very same frame as the Pressing event. Use this event for button clicks and gestures. View code on GitHub
Pressing2 A button or key was just pressed, this will be true for the first tick when the button or key was just pressed. Not used for most gestures, which only care about the Releasing state View code on GitHub
Pressed3 This state will be true for every tick the button or key is being pressed (except for the initial tick when Pressing is used, to check for all pressing states use PressingOrPressed). Events of this type are also fired each frame. View code on GitHub
Remarks

Tests: DeltaEngine.Input.Tests.StateExtensionsTests
Examples

1 unit tests call DeltaEngine.Input.State
[Test]
public void TestUpdateStates()
{
    var state = State.Released;
    state = state.UpdateOnNativePressing(true);
    Assert.AreEqual(State.Pressing, state);
    state = state.UpdateOnNativePressing(true);
    Assert.AreEqual(State.Pressed, state);
    state = state.UpdateOnNativePressing(false);
    Assert.AreEqual(State.Releasing, state);
    state = state.UpdateOnNativePressing(false);
    Assert.AreEqual(State.Released, state);
}
See Also