internal void ProcessTouch(string actionType, XPointerEventArgs args)
        {
            switch (actionType)
            {
            case "Cancelled":
                PointerLost?.Invoke(this, args);
                break;

            case "Entered":
                PointerEntered?.Invoke(this, args);
                break;

            case "Exited":
                PointerExited?.Invoke(this, args);
                break;

            case "Moved":
                PointerMoved?.Invoke(this, args);
                break;

            case "Pressed":
                PointerPressed?.Invoke(this, args);
                break;

            case "Released":
                PointerReleased?.Invoke(this, args);
                break;
            }
        }
Beispiel #2
0
        private void Element_MouseLeave(object sender, MouseEventArgs args)
        {
            var position = GetPosition(args);
            var buttons  = GetMouseButtons(args);

            if ((buttons & PointerId.MouseLeftButton) != 0)
            {
                PointerLost?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(PointerId.MouseLeftButton), buttons));
            }

            if ((buttons & PointerId.MouseRightButton) != 0)
            {
                PointerLost?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(PointerId.MouseRightButton), buttons));
            }

            if ((buttons & PointerId.MouseMiddleButton) != 0)
            {
                PointerLost?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(PointerId.MouseMiddleButton), buttons));
            }

            PointerLost?.Invoke(this, new PointerEventArgs(CurrentTime, position, PointerId.FromMouse(PointerId.MouseNoButton), buttons));
        }
Beispiel #3
0
 private void UnprocessedInput_PointerLost(InkUnprocessedInput sender, PointerEventArgs args)
 {
     PointerLost?.Invoke(args.CurrentPoint);
 }