Exemple #1
0
        // Method called when a gesture is detected.
        // Based on the kind of gesture, an action is performed.
        private static void OnGestureDetected(object sender, GestureSegmentTriggeredEventArgs args, ConsoleColor foregroundColor)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("Gesture detected: ");
            Console.ForegroundColor = foregroundColor;
            Console.WriteLine(args.GestureSegment.Name);
            Console.ResetColor();

            if (args.GestureSegment.Name == "FingerSnap")
            {
                _keyboard.Send(Keyboard.VirtualKeyShort.RIGHT);
            }
            else if (args.GestureSegment.Name == "RotateRight")
            {
                _keyboard.Send(Keyboard.VirtualKeyShort.RIGHT);
            }
            else if (args.GestureSegment.Name == "RotateLeft")
            {
                _keyboard.Send(Keyboard.VirtualKeyShort.LEFT);
            }
            else if (args.GestureSegment.Name == "RotateRightLeftHand")
            {
                _keyboard.Send(Keyboard.VirtualKeyShort.RIGHT);
            }
            else if (args.GestureSegment.Name == "RotateLeftLeftHand")
            {
                _keyboard.Send(Keyboard.VirtualKeyShort.LEFT);
            }
        }
Exemple #2
0
 private static void OnGestureDetected(object sender, GestureSegmentTriggeredEventArgs args, ConsoleColor foregroundColor)
 {
     Console.ForegroundColor = ConsoleColor.Red;
     Console.Write("Gesture detected! : ");
     Console.ForegroundColor = foregroundColor;
     Console.WriteLine(args.GestureSegment.Name);
     Console.ResetColor();
 }
Exemple #3
0
        private static void OnGestureDetected(object sender, GestureSegmentTriggeredEventArgs args, ConsoleColor foregroundColor)
        {
            LightListResponse response;

            string gesture = args.GestureSegment.Name;

            if (gesture == "RotateUp1")
            {
                response = lightAPIs["Onefinger"].BrightnessUp();
            }
            else if (gesture == "RotateDown1")
            {
                response = lightAPIs["Onefinger"].BrightnessDown();
            }
            else if (gesture == "RotateUp2")
            {
                response = lightAPIs["TwoFingers"].BrightnessUp();
            }
            else if (gesture == "RotateDown2")
            {
                response = lightAPIs["TwoFingers"].BrightnessDown();
            }
            else if (lightAPIs.ContainsKey(gesture))
            {
                response = lightAPIs[gesture].Toggle();
            }
            else if (gesture == "Open")
            {
                LifxAPI.TurnOnAll();
            }
            else if (gesture == "Close")
            {
                LifxAPI.TurnOffAll();
            }

            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write("Gesture detected! : ");
            Console.ForegroundColor = foregroundColor;
            Console.WriteLine(gesture);
            Console.ResetColor();
        }
        private void OnShareWithGesture(object sender, GestureSegmentTriggeredEventArgs e)
        {
            Globals.ThisAddIn.Application.CommandBars.ExecuteMso("FileSendAsAttachment");

            Outlook.MailItem mailItem = null;
            for (int attempt = 0; attempt < MailItemPopTimeout / 500; attempt++)
            {
                Task.Delay(500).Wait();

                Outlook.Application outlook = new Outlook.Application();
                mailItem = outlook.ActiveInspector().CurrentItem as Outlook.MailItem;
                if (mailItem != null)
                {
                    break;
                }
            }

            mailItem.To      = Settings.Default.DefaultTo;
            mailItem.Subject = Settings.Default.DefaultSubject;
            mailItem.Body    = Settings.Default.DefaultMessage;
        }
Exemple #5
0
 private void CurrentGesture_Triggered(object sender, GestureSegmentTriggeredEventArgs e)
 {
     WriteLogMessage($"[GESTURE] - {e.GestureSegment} - {e.NestingPath}", Colors.Black);
 }
Exemple #6
0
 private void Pose_Triggered(object sender, GestureSegmentTriggeredEventArgs e)
 {
     WriteLogMessage($"[POSE] - {e.GestureSegment }", Colors.Green);
 }
 private void OnStartPresentation(object sender, GestureSegmentTriggeredEventArgs e)
 {
     Globals.ThisAddIn.Application.ActivePresentation?.SlideShowSettings?.Run();
 }
 private void OnNextSlide(object sender, GestureSegmentTriggeredEventArgs e)
 {
     Globals.ThisAddIn.Application.ActivePresentation?.SlideShowWindow?.View?.Next();
 }