private void SetAction(MyomiGesture gesture)
        {
            Console.WriteLine("What would you like to bind this gesture to?");
            Console.WriteLine("Please type the key or key name if you want to bind this to in a single word");
            Console.WriteLine("Example: binding the 'enter' key, please type 'enter', for page up, type 'pageup'");
            Console.WriteLine("For mouse keys, type in the mouse key: 'leftclick', 'rightclick'");

            VirtualKeyCode parsedBind;

            do
            {
                Console.WriteLine("Please type in the key you would like to bind this gesture to");
                var keybind = Console.ReadLine();
                parsedBind = KeyToKeyBind.ParseKey(keybind);
                if (parsedBind == VirtualKeyCode.NONAME)
                {
                    Console.WriteLine("The key bind you entered is not valid");
                }
            } while (parsedBind != VirtualKeyCode.NONAME);

            int delay = 10;

            Console.WriteLine("Would you like to add a delay (in millisecond) between key and and key down?");
            if (CommonOperations.GetYesOrNo())
            {
                string delayString = "";
                do
                {
                    Console.WriteLine("Please input the amount of delay in millisecond");
                    delayString = Console.ReadLine();
                } while (!Int32.TryParse(delayString, out delay));
            }

            gesture.Action = new MyomiGestureAction(parsedBind, delay);
        }
        private bool CalibrateGesture(MyomiGesture gesture, MyomiGestureOptions options)
        {
            var task    = new GestureCreatorMatchingTask(gesture.SegmentsWithOptions, options);
            var manager = new MyomiTaskManager(Context.Instance.DefaultFrequency, task);

            for (int i = 0; i < 3 || task.Matched; i++)
            {
                var taskThread = new Thread(manager.Run);
                taskThread.Start();
                //sleep until it has finished
                while (!manager.StopExecution)
                {
                }
                if (!task.Matched)
                {
                    return(false);
                }
            }
            return(true);
        }
 private void SaveGesture(MyomiGesture gesture)
 {
     Context.Instance.CurrentProfile.AddGesture(gesture);
 }