MouseButton EnumerationDelta Engine Documentation
Normally we only care about left, middle or right mouse button clicks, rarely for the others. 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 MouseButton
Members

  Member nameValueDescription
Left0
Middle1
Right2
X13
X24
Remarks

Tests: DeltaEngine.Input.Tests.MouseButtonTriggerTests
Examples

5 unit tests call DeltaEngine.Input.MouseButton
[Test]
public void PressLeftMouseButtonToCloseWindow()
{
    new FontText(Font.Default, "Press Left Mouse Button to close window", Rectangle.One);
    new Command(() => Resolve<Window>().CloseAfterFrame()).Add(new MouseButtonTrigger());
}
[Test]
public void ClickAndHoldToShowRedEllipseAtMousePosition()
{
    var ellipse = new Ellipse(new Rectangle(-0.1f, -0.1f, 0.1f, 0.1f), Color.Red);
    new Command(position => ellipse.Center = position).Add(new MouseButtonTrigger(State.Pressed));
}
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new MouseButtonTrigger(MouseButton.Right, State.Pressed);
    Assert.AreEqual(MouseButton.Right, trigger.Button);
    Assert.AreEqual(State.Pressed, trigger.State);
    Assert.AreEqual(MouseButton.Left, new MouseButtonTrigger().Button);
    Assert.AreEqual(State.Pressing, new MouseButtonTrigger().State);
    Assert.AreEqual(MouseButton.Left, new MouseButtonTrigger(State.Pressed).Button);
    Assert.AreEqual(State.Pressed, new MouseButtonTrigger(State.Pressed).State);
}
See Also