示例#1
0
    private void OnFingerDown(PointerDownEvent evt)
    {
        if (evt.pointerType == PointerType.touch && evt.currentTarget == evt.target)
        {
            var ve = evt.target as VisualElement;
            OnDown(ve);

            // Prevent compatibility mouse events from being fired for this pointer.
            evt.PreventDefault();
        }
    }
 private void UpdateValueOnPointerDown(PointerDownEvent evt)
 {
     if (CanStartDrag(evt.button, evt.localPosition))
     {
         if (evt.pointerId != PointerId.mousePointerId)
         {
             evt.PreventDefault();
             m_DragElement.CapturePointer(evt.pointerId);
             ProcessDownEvent(evt);
         }
         else
         {
             evt.StopImmediatePropagation();
         }
     }
 }