MouseTapTrigger ClassDelta Engine Documentation
Allows mouse button tap to be tracked. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Commands Trigger
      DeltaEngine.Commands InputTrigger
        DeltaEngine.Input MouseTapTrigger

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

public class MouseTapTrigger : InputTrigger, 
	MouseTrigger

The MouseTapTrigger type exposes the following members.

Constructors

  NameDescription
Public methodMouseTapTrigger(Dictionary String, String )
Initializes a new instance of the MouseTapTrigger class
Public methodMouseTapTrigger(MouseButton)
Initializes a new instance of the MouseTapTrigger class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Public methodHandleWithMouse
Public methodInvoke (Inherited from Trigger.)
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodStart T  (Inherited from Entity.)
Protected methodStartInputDevice (Overrides InputTrigger StartInputDevice .)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Public methodUpdate (Inherited from Trigger.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Public fieldInvoked (Inherited from Trigger.)
Top
Properties

  NameDescription
Public propertyButton
Public propertyIsActive (Inherited from Entity.)
Public propertyIsPauseable (Inherited from Trigger.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyWasInvokedThisTick (Inherited from Trigger.)
Top
Remarks

Tests: DeltaEngine.Input.Tests.MouseTapTriggerTests
Examples

2 unit tests call DeltaEngine.Input.MouseTapTrigger
[Test, CloseAfterFirstFrame]
public void Tap()
{
    var mouse = Resolve<Mouse>() as MockMouse;
    if (mouse == null)
        return; //ncrunch: no coverage 
    bool wasTapped = false;
    new Command(() => wasTapped = true).Add(new MouseTapTrigger(MouseButton.Left));
    SetMouseState(mouse, State.Pressing, Vector2D.Half);
    Assert.IsFalse(wasTapped);
    SetMouseState(mouse, State.Releasing, Vector2D.Half);
    Assert.IsTrue(wasTapped);
}
[Test]
public void CreateMouseTapTriggerBySendingButtonName()
{
    var trigger = new MouseTapTrigger(new Dictionary<string, string> { { "Button", "Middle" } });
See Also