-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
49 lines (43 loc) · 1.25 KB
/
Program.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
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Leap;
namespace WindowsFormsApplication1
{
class WinFormsListener : Listener
{
public event Action<Controller> Frame;
public override void OnInit(Controller controller)
{
}
public override void OnConnect(Controller controller)
{
controller.EnableGesture(Gesture.GestureType.TYPECIRCLE);
controller.EnableGesture(Gesture.GestureType.TYPEKEYTAP);
controller.EnableGesture(Gesture.GestureType.TYPESCREENTAP);
controller.EnableGesture(Gesture.GestureType.TYPESWIPE);
}
public override void OnDisconnect(Controller controller)
{
}
public override void OnExit(Controller controller)
{
}
public override void OnFrame(Controller controller)
{
if (Frame != null) Frame(controller);
}
}
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}