Allows mouse button tap to be tracked.
View code on GitHub
Inheritance Hierarchy
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
The MouseTapTrigger type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MouseTapTrigger(Dictionary String, String ) | Initializes a new instance of the MouseTapTrigger class | |
MouseTapTrigger(MouseButton) | Initializes a new instance of the MouseTapTrigger class |
Methods
Name | Description | |
---|---|---|
Add T | (Inherited from Entity.) | |
AddTag | (Inherited from Entity.) | |
ClearTags | (Inherited from Entity.) | |
Contains T | (Inherited from Entity.) | |
ContainsBehavior T | (Inherited from Entity.) | |
ContainsTag | (Inherited from Entity.) | |
Deactivate | (Inherited from Entity.) | |
Dispose | (Inherited from Entity.) | |
Get T |
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D)
View code on GitHub (Inherited from Entity.) | |
GetActiveBehaviors | (Inherited from Entity.) | |
GetComponentsForSaving | (Inherited from Entity.) | |
GetOrDefault T | (Inherited from Entity.) | |
GetTags | (Inherited from Entity.) | |
HandleWithMouse | ||
Invoke | (Inherited from Trigger.) | |
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
Set | (Inherited from Entity.) | |
SetComponents | (Inherited from Entity.) | |
Start T | (Inherited from Entity.) | |
StartInputDevice | (Overrides InputTrigger StartInputDevice .) | |
Stop T | (Inherited from Entity.) | |
ToString | (Inherited from Entity.) | |
Update | (Inherited from Trigger.) |
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) | |
Invoked | (Inherited from Trigger.) |
Properties
Name | Description | |
---|---|---|
Button | ||
IsActive | (Inherited from Entity.) | |
IsPauseable | (Inherited from Trigger.) | |
NumberOfComponents | (Inherited from Entity.) | |
UpdatePriority | (Inherited from Entity.) | |
WasInvokedThisTick | (Inherited from Trigger.) |
Remarks
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