protected override void OnKinectCursorMove(object sender, KinectCursorEventArgs e)
 {
     if (e.Z < _handDepth - PushThreshold)
     {
         RaiseEvent(new RoutedEventArgs(ClickEvent));
     }
 }
Example #2
0
 protected override void OnKinectCursorMove(object sender, KinectCursorEventArgs e)
 {
     if (e.Z < _handDepth - PushThreshold)
     {
         RaiseEvent(new RoutedEventArgs(ClickEvent));
     }
 }
Example #3
0
        private void Button_KinectCursorLeave(object sender, KinectCursorEventArgs e)
        {
            var button = sender as KinectButton;

            button.Background = new SolidColorBrush(Colors.Red);
            // _continue = false;
            readThread.Interrupt();
        }
Example #4
0
 override protected void OnKinectCursorLeave(object sender, KinectCursorEventArgs e)
 {
     if (_timerEnabled)
     {
         e.Cursor.StopCursorAnimation();
         _hoverTimer.Stop();
     }
 }
Example #5
0
 override protected void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     if (_timerEnabled)
     {
         _hoverTimer.Interval = TimeSpan.FromMilliseconds(HoverInterval);
         e.Cursor.AnimateCursor(HoverInterval);
         _hoverTimer.Start();
     }
 }
Example #6
0
        protected override void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
        {
            if (this.Opacity == 0)
            {
                return;
            }
            //Debug.WriteLine("Enter ");
            if (!_isLockOn)
            {
                return;
            }
            // get button position
            var rootVisual = FindAncestor <Window>(this);
            var point      = this.TransformToAncestor(rootVisual)
                             .Transform(new Point(0, 0));

            var x = point.X + this.ActualWidth / 2;
            var y = point.Y + this.ActualHeight / 2;

            var cursor = e.Cursor;

            cursor.UpdateCursor(new Point(e.X, e.Y), true);

            // find target position
            Point lockPoint = new Point(x - cursor.CursorVisual.ActualWidth / 2 + LockXOffsetFromCenter, y - cursor.CursorVisual.ActualHeight / 2 + LockYOffsetFromCenter);

            // find current location
            Point cursorPoint = new Point(e.X - cursor.CursorVisual.ActualWidth / 2, e.Y - cursor.CursorVisual.ActualHeight / 2);

            // guide cursor to its final position
            DoubleAnimation moveLeft = new DoubleAnimation(cursorPoint.X, lockPoint.X, new Duration(TimeSpan.FromMilliseconds(LockInterval)));

            Storyboard.SetTarget(moveLeft, cursor.CursorVisual);
            Storyboard.SetTargetProperty(moveLeft, new PropertyPath(Canvas.LeftProperty));
            DoubleAnimation moveTop = new DoubleAnimation(cursorPoint.Y, lockPoint.Y, new Duration(TimeSpan.FromMilliseconds(LockInterval)));

            Storyboard.SetTarget(moveTop, cursor.CursorVisual);
            Storyboard.SetTargetProperty(moveTop, new PropertyPath(Canvas.TopProperty));
            move = new Storyboard();
            move.Children.Add(moveTop);
            move.Children.Add(moveLeft);

            move.Completed += delegate
            {
                this.RaiseEvent(new KinectCursorEventArgs(KinectCursorLockEvent, new Point(x + LockXOffsetFromCenter, y + LockYOffsetFromCenter), e.Z)
                {
                    Cursor = e.Cursor
                });
            };
            if (move != null)
            {
                move.Stop(e.Cursor);
            }
            move.Begin(cursor, false);
            base.OnKinectCursorEnter(sender, e);
        }
Example #7
0
        private void Button_KinectCursorLeave(object sender, KinectCursorEventArgs e)
        {
            var button = sender as KinectButton;

            button.Background = new SolidColorBrush(Colors.Red);
            //_continue = false;

            //listBox1.Items.Add(string.Format("your hand leave button {0}", DateTime.Now.ToLongTimeString()));
            angleX += 20;
        }
Example #8
0
 void KnctManager_SwipeOutOfBoundsDetected(object sender, KinectCursorEventArgs e)
 {
     DeInitializeSwipe();
     RaiseEvent(new KinectCursorEventArgs(SwipeOutOfBoundsEvent));
 }
Example #9
0
 protected virtual void OnKinectCursorMove(Object sender, KinectCursorEventArgs e) { }
Example #10
0
 protected virtual void OnKinectCursorEnter(Object sender, KinectCursorEventArgs e)
 {
     RaiseEvent(new RoutedEventArgs(ClickEvent));
 }
 protected virtual void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     RaiseEvent(new RoutedEventArgs(ClickEvent));
 }
Example #12
0
 protected override void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     _handDepth = e.Z;
 }
Example #13
0
 private void upBtnHover_KinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     angleY += 20;
 }
Example #14
0
 private void rightBtnHover_KinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     angleX -= 20;
 }
Example #15
0
 void KnctManager_SwipeDetected(object sender, KinectCursorEventArgs e)
 {
     InitializeSwipe();
     RaiseEvent(new RoutedEventArgs(ClickEvent));
 }
Example #16
0
 protected override void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     InitializeSwipe();
     base.OnKinectCursorEnter(sender, e);
 }
 protected override void OnKinectCursorEnter(object sender, KinectCursorEventArgs e)
 {
     _handDepth = e.Z;
 }
 protected virtual void OnKinectCursorMove(object sender, KinectCursorEventArgs e)
 {
 }
Example #19
0
 protected override void OnKinectCursorMove(object sender, KinectCursorEventArgs e)
 {
     _lastPointDetected = e;
 }