I just use the console application to say it.
Getting the coordinates is the rewriting of his own listener Onframe event.
It is best not to use Console.WriteLine When overriding listener because he is using multiple threads, direct use can cause thread conflicts.
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using Leap; Namespace ConsoleApplication6 {class Program {static void Main (string[] args) {Cont
Roller leap = new Controller ();
Alistener listener = new Alistener (); Leap.
AddListener (listener); Console.WriteLine (Leap.
Devices[0]);
Console.WriteLine ("Press Enter to quit ..."); Console.ReadLine (); Keep this process running until the Enter is pressed leap.
RemoveListener (listener); Leap.
Dispose ();
} public class Alistener:listener {Object thislock = new Object (); void Safewriteline (string line) {Lock (Thislock) {Console.WriteLine
);
} public override void OnConnect (Controller arg0) {safewriteline ("conectted"); } PubLic override void Onframe (Controller arg0) {Frame frame = arg0.
Frame (); Handlist hlist = frame.
hands;
Hand hand1 = hlist[0]; Safewriteline (Hand1. Palmposition.x.tostring () + "" + hand1. Palmposition.y.tostring () + "" + hand1.
Palmposition.z.tostring ());
Hand hand2 = hlist[1]; Safewriteline (Hand2. Palmposition.x.tostring () + "" + hand2. Palmposition.y.tostring () + "" + hand2.
Palmposition.z.tostring () + "\ n"); Safewriteline (arg0. Frame ().
Id.tostring ());
public override void OnInit (Controller arg0) {safewriteline ("Inti");
}
}
}