Private Sub OnPropert圜hanged( ByVal propertyName As String) Private Const SHIFT As Double = 1 Public Sub New()ĪddHandler listener.LeapSwipe, AddressOf SwipeActionĮnd Sub Private _xAngle As Double Public Property XAngle As Double Get Return _xAngleĮnd Set End Property Private _yAngle As Double Public Property YAngle As Double Get Return _yAngleĮnd Set End Property Private Sub SwipeAction( ByVal sd As SwipeDirection)Įxit Select End Select End Sub Public Sub DisposeListener()Įnd Sub Public Event Propert圜hanged(sender As Object,Į As Propert圜hangedEventArgs) Implements INotifyPropert圜hanged.Propert圜hanged The SwipeDirection enum contains values for four swipe-gesture directions I'm interested in, This is where I process the data from the Leap toĭetermine the direction of a swipe gesture. The OnFrame() callback method is called when the Leap generates a new frame The minimum length and velocity to very small values, 10mm and 100mm/s. Since I want toĭetect slight hand/finger movements as swipe-gestures I have set the values of Velocity required to detect this gesture (The length and velocity values are in This is the method where you enable detection of swipe-gestures and set the minimum length and
The OnConnect() callback method is called when your applicationĬonnects to the Leap. Public void SwipeAction(FingerList fingers, SwipeDirection sd) Public delegate void SwipeEvent(SwipeDirection sd) SwipeAction(fingers, SwipeDirection.Down) SwipeAction(fingers, SwipeDirection.Left) SwipeAction(fingers, SwipeDirection.Right) If (Math.Abs() > Math.Abs()) // Horizontal swipe SwipeGesture swipe = new SwipeGesture(gst) GestureList gestures = currentFrame.Gestures() Public override void OnFrame(Controller ctrl) Public override void OnConnect(Controller ctlr)Ĭ( " ", 10) Ĭ( " ", 100) Ĭtlr.EnableGesture() RaiseEvent LeapSwipe(SwipeDirection.Down)Įxit Select End Select End If End Sub End Class RaiseEvent LeapSwipe(SwipeDirection.Left)
RaiseEvent LeapSwipe(SwipeDirection.Right) If (fingersCount = 5) Then Select Case sd Private fingersCount As Integer Private Sub SwipeAction( ByVal fingers As FingerList, ByVal sd As SwipeDirection) SwipeAction(fingers, SwipeDirection.Down)Įnd If End If Exit For End If Next End If End If End Sub Public Delegate Sub SwipeEvent( ByVal sd As SwipeDirection) SwipeAction(fingers, SwipeDirection.Left)Įnd If Else ' Vertical swipe If ( > 0) Then ' upward swipe If (Math.Abs() > Math.Abs()) Then ' Horizontal swipe If ( > 0) Then ' right swipe If gst.Type = Then Dim swipe As New SwipeGesture(gst) If ( Not fingers.Empty) Then Dim gestures As GestureList = currentFrame.Gestures
If ( Not ) Then Dim firstHand As Hand = currentFrame.Hands( 0)ĭim fingers As FingerList = firstHand.Fingers Public Overrides Sub OnConnect(ctlr As Controller)Ĭ( " ", 10)Ĭ( " ", 100)Ĭtlr.EnableGesture()Įnd Sub Public Overrides Sub OnFrame(ctlr As Controller)