public void TranslateTouchEvent(object sender, RawPointsDataMessageEventArgs e)
        {
            int releaseCount = e.RawTouchsData.Count(rtd => !rtd.Tip);
            if (releaseCount != 0)
            {
                if (e.RawTouchsData.Count <= _lastPointsCount)
                {
                    OnTouchUp(e);
                    _lastPointsCount = _lastPointsCount - releaseCount;
                }
                return;
            }

            if (e.RawTouchsData.Count > _lastPointsCount)
            {
                if (TouchCapture.Instance.InputPoints.Any(p => p.Count > 10))
                {
                    OnTouchMove(e);
                    return;
                }
                _lastPointsCount = e.RawTouchsData.Count;
                OnTouchDown(e);
            }
            else if (e.RawTouchsData.Count == _lastPointsCount)
            {
                OnTouchMove(e);
            }
        }
Exemplo n.º 2
0
        protected void TouchEventTranslator_TouchUp(object sender, RawPointsDataMessageEventArgs e)
        {
            if (State == CaptureState.Capturing)
            {
                if (TemporarilyDisableCapture && Mode == CaptureMode.UserDisabled)
                {
                    TemporarilyDisableCapture = false;
                    ToggleUserDisableTouchCapture();
                }

                EndCapture();
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
                _pointsCaptured = null;
            }

        }
Exemplo n.º 3
0
        protected void TouchEventTranslator_TouchMove(object sender, RawPointsDataMessageEventArgs e)
        {

            // Only add point if we're capturing
            if (State == CaptureState.Capturing)
            {
                if (_timeoutTimer.Enabled)
                    _timeoutTimer.Stop();

                AddPoint(e.RawTouchsData);
            }
        }
Exemplo n.º 4
0
        protected void PointEventTranslator_TouchDown(object sender, RawPointsDataMessageEventArgs e)
        {
            // Can we begin a new gesture capture

            if (State == CaptureState.Ready || State == CaptureState.Capturing)
            {
                Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;

                // Try to begin capture process, if capture started then don't notify other applications of a Touch event, otherwise do
                if (!TryBeginCapture(e.RawTouchsData))
                {
                    Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.Normal;
                }
            }
        }
 protected virtual void OnTouchUp(RawPointsDataMessageEventArgs args)
 {
     if (TouchUp != null) TouchUp(this, args);
 }