示例#1
0
 public void StartTest(GestureDirection direction)
 {
     GestureParser.SetDirectionContext(direction);
     gestureTypeList = GetRandomGestureList();
     ChangeGesture();
 }
示例#2
0
        private void Window_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == System.Windows.Input.Key.Space)
            {
                Background = Brushes.Black;/*
                                            * if (connection == null || !connection.Connected) {
                                            * connectedLabel.BeginAnimation(Canvas.OpacityProperty, CreateAnimation(5, 1, 0));
                                            * return;
                                            * }*/
                if (currentTest == null)
                {
                    currentTest = new TestSuite(this, source);
                    kinectManager.Recalibrate();
                    testIDLabel.Content = "User ID: " + currentTest.UserID;
                    testIDLabel.BeginAnimation(Canvas.OpacityProperty, CreateAnimation(10, 1, 0));
                }
                else if (runningTest && !runningGesture)
                {
                    currentTest.ChangeGesture();
                }
            }
            else if (e.Key == System.Windows.Input.Key.Up)
            {
                if (currentTest != null)
                {
                    currentTest.StartTest(GestureDirection.Push);
                }
            }
            else if (e.Key == System.Windows.Input.Key.Down)
            {
                if (currentTest != null)
                {
                    currentTest.StartTest(GestureDirection.Pull);
                }
            }

            else if (e.Key == System.Windows.Input.Key.I)
            {
                PointAt(0, 0);
            }

            else if (e.Key == System.Windows.Input.Key.Q)
            {
                StartDebugTest(GestureType.Swipe);
            }
            else if (e.Key == System.Windows.Input.Key.W)
            {
                StartDebugTest(GestureType.Throw);
            }
            else if (e.Key == System.Windows.Input.Key.E)
            {
                StartDebugTest(GestureType.Pinch);
            }
            else if (e.Key == System.Windows.Input.Key.R)
            {
                StartDebugTest(GestureType.Tilt);
            }

            else if (e.Key == System.Windows.Input.Key.Enter)
            {
                kinectManager.Recalibrate();
                ShowStatusMessage("Recalibrating...");
            }

            else if (e.Key == System.Windows.Input.Key.U)
            {
                VideoWindow.PlayVideo(GestureDirection.Pull, types.Dequeue());
            }

            else if (e.Key == System.Windows.Input.Key.A)
            {
                ShowStatusMessage("Push");
                GestureParser.SetDirectionContext(GestureDirection.Push);
            }
            else if (e.Key == System.Windows.Input.Key.S)
            {
                ShowStatusMessage("Pull");
                GestureParser.SetDirectionContext(GestureDirection.Pull);
            }
        }