示例#1
0
        private void sensor_AllFramesReady(object sender, AllFramesReadyEventArgs e)
        {
            Skeleton first = GetFirstSkeleton(e);

            Dictionary <BaseGesture, int> gestures = new Dictionary <BaseGesture, int>();

            gestures.Add(new HandsOut(), 0x22);
            gestures.Add(new HandsIn(), 0x21);
            gestures.Add(new PanUp(), 0x26);
            gestures.Add(new PanDown(), 0x28);
            gestures.Add(new PanLeft(), 0x25);
            gestures.Add(new PanRight(), 0x27);

            foreach (BaseGesture gesture in gestures.Keys)
            {
                KeyPressEmulator.setKeyPressed(gestures[gesture], false);
            }

            foreach (BaseGesture gesture in gestures.Keys)
            {
                if (gesture.CheckGesture(first) == GestureResult.Success)
                {
                    KeyPressEmulator.setKeyPressed(gestures[gesture], true);
                    break;
                }
            }
        }
示例#2
0
 private void testZoomInAndOutKeys()
 {
     KeyPressEmulator.setKeyPressed(0x21, true);
     Thread.Sleep(5000);
     KeyPressEmulator.setKeyPressed(0x21, false);
     Thread.Sleep(5000);
     KeyPressEmulator.setKeyPressed(0x22, true);
     Thread.Sleep(5000);
     KeyPressEmulator.setKeyPressed(0x22, false);
     Thread.Sleep(5000);
 }