Exemple #1
0
 void EventManager_MultiTouchChanged(object sender, MultiTouchEventArgs e)
 {
     // Raw touch data
     // e.TouchPoints
 }
Exemple #2
0
 void EventManager_MultiTouchChanged(object sender, MultiTouchEventArgs e)
 {
     int x = 0;
 }
Exemple #3
0
        private void ActiveHardware_MultiTouchChanged(Object sender, MultiTouchEventArgs e)
        {
            if (MultiTouchChanged != null)
                MultiTouchChanged(sender, e);

            // Validate pre-conditions
            ValidSetOfTouchPoints availableTouchPoints = e.TouchPoints.Copy();

            ValidSetOfPointsCollection dataToEvaluate = new ValidSetOfPointsCollection();
            dataToEvaluate.Add(availableTouchPoints);

            // Validate gestures that are in progess
            ValidateBlockResult[] list = PartiallyEvaluatedGestures.GetAll();
            foreach (ValidateBlockResult item in list)
            {
                Gesture gesture = GestureLanguageProcessor.ActiveGestures[item.GestureName.ToLower()];
                dataToEvaluate.ExpectedGestureName = gesture.Name;
                int stepToValidate = item.ValidateBlockNo +1;

                if (gesture != null)
                {
                    if (gesture.ValidationBlocks.Count > stepToValidate)
                    {
                        var result = ValidateGesture(gesture, dataToEvaluate, stepToValidate);

                        // If its the second last step then also run the last step
                        if (result.Count > 0)
                        {
                            if (gesture.ValidationBlocks.Count == stepToValidate + 2)
                            {
                                stepToValidate++;
                                result = ValidateGesture(gesture, dataToEvaluate, stepToValidate);
                            }
                        }

                        // If its the final step of a gesture, then delete all related partial results from cache
                        if (gesture.ValidationBlocks.Count == stepToValidate + 1)
                        {
                            PartiallyEvaluatedGestures.Remove(item);
                            PartiallyEvaluatedGestures.cleanBuffer();
                        }

                        // Remove touch points that are used in multi-step gesture from
                        // touch points list for new gestures
                     //   dataToEvaluate.Remove(result);
                    }
                }
            }

            // Validate gestures from the first validate block as if new gestures
            foreach (Gesture gesture in GestureLanguageProcessor.ActiveGestures.Values)
            {
                // Cleans buffer for the Primitives to use it
               // PartiallyEvaluatedGestures.cleanBuffer();
                if (dataToEvaluate.Count > 0)
                    ValidateGesture(gesture, dataToEvaluate, 0);
            }
        }