MouseTapTriggerTests Tap Method Delta Engine Documentation

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

public void Tap()
Examples

[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