Skip to content

Instantly share code, notes, and snippets.

@elbruno
Created May 29, 2014 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbruno/7f96407ea0b59f894ba8 to your computer and use it in GitHub Desktop.
Save elbruno/7f96407ea0b59f894ba8 to your computer and use it in GitHub Desktop.
El Bruno - Leap V2 SDK Beta Controller
using System;
using System.Threading.Tasks;
using Leap;
namespace ElBruno.LeapV2NewFeatures
{
public class MotionListener : Listener
{
public event Action<bool, bool> OnLeftOrRightHand;
public event Action<float, float> OnPitchAndGrab;
public override void OnFrame(Controller controller)
{
var frame = controller.Frame();
if (frame.Hands.IsEmpty) return;
var hand = frame.Hands[0];
Task.Factory.StartNew(() => OnLeftOrRightHand(hand.IsLeft, hand.IsRight));
Task.Factory.StartNew(() => OnPitchAndGrab(hand.PinchStrength, hand.GrabStrength));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment