All states a mouse button, keyboard key, touch, gamepad or gesture may have.
View code on GitHub
Namespace: DeltaEngine.InputAssembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Members
Member name | Value | Description | |
---|---|---|---|
Released | 0 | Default state for any button, key or gesture, no input is happening, no event will be fired View code on GitHub | |
Releasing | 1 | 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 | |
Pressing | 2 | 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 | |
Pressed | 3 | 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
Examples
[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