-
-
Notifications
You must be signed in to change notification settings - Fork 425
/
Copy pathITouchDevice.cs
48 lines (41 loc) · 1.56 KB
/
ITouchDevice.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Numerics;
namespace Silk.NET.Input
{
/// <summary>
/// An interface representing a touch device.
/// </summary>
public interface ITouchDevice : IInputDevice, IDisposable
{
/// <summary>
/// The known fingers this touch device has tracked.
/// </summary>
// ReSharper disable once ReturnTypeCanBeEnumerable.Global
IReadOnlyDictionary<long, TouchFinger> Fingers { get; }
/// <summary>
/// A recognizer for gestures.
/// </summary>
TouchGestureRecognizer GestureRecognizer { get; }
/// <summary>
/// Checks if a specific finger is currently down on the touch surface.
/// </summary>
/// <param name="index">The finger index to check.</param>
/// <returns>Whether or not the finger is pressed down.</returns>
bool IsFingerDown(long index);
/// <summary>
/// Called when a finger touches the surface.
/// </summary>
event Action<ITouchDevice, TouchFinger>? FingerDown;
/// <summary>
/// Called when a finger is lifted from the surface.
/// </summary>
event Action<ITouchDevice, TouchFinger>? FingerUp;
/// <summary>
/// Called when the finger is moved while on the surface.
/// </summary>
event Action<ITouchDevice, TouchFinger, Vector2>? FingerMove;
}
}