summaryrefslogtreecommitdiff
path: root/Penguloon/Controls/ControlBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Penguloon/Controls/ControlBase.cs')
-rw-r--r--Penguloon/Controls/ControlBase.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Penguloon/Controls/ControlBase.cs b/Penguloon/Controls/ControlBase.cs
index b6b7a57..bbd3a14 100644
--- a/Penguloon/Controls/ControlBase.cs
+++ b/Penguloon/Controls/ControlBase.cs
@@ -25,6 +25,7 @@ namespace Penguloon.Controls
public Texture2D BackgroundDisabled { get; set; }
public event EventHandler OnMissClick;
+ public event EventHandler<ClickArgs> OnFingerDown;
public event EventHandler<ClickArgs> OnClick;
public event EventHandler<MoveArgs> OnMove;
@@ -92,7 +93,7 @@ namespace Penguloon.Controls
if (touchRec.Intersects(controlRec))
{
- if (touchLocations[i].State == TouchLocationState.Released)
+ if (touchLocations[i].State == TouchLocationState.Released && this.ControlState == ControlState.Pressed)
{
this.ControlState = ControlState.Idle;
OnClick?.Invoke(this, new ClickArgs(touchLocations[i].Position));
@@ -101,10 +102,12 @@ namespace Penguloon.Controls
if (touchLocations[i].State == TouchLocationState.Pressed)
{
this.ControlState = ControlState.Pressed;
+ OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position));
}
if (touchLocations[i].State == TouchLocationState.Moved)
{
+ OnFingerDown?.Invoke(this, new ClickArgs(touchLocations[i].Position));
touchLocations[i].TryGetPreviousLocation(out TouchLocation touch);
OnMove?.Invoke(this, new MoveArgs(touchLocations[i].Position, touch.Position));
}