public override bool Poll()
        {
            bool returnStatus = false;



            MouseStateEventData[] eventDataArray;

            lock (_mouseEventData)
            {
                eventDataArray = _mouseEventData.ToArray();
                _mouseEventData.Clear();
            }

            if (eventDataArray.Length == 0)
            {
                return(returnStatus);
            }


            MouseButtons[] currentState = _getButtonState(eventDataArray);

            Point currentPoint = eventDataArray[0].Data.Position;


            MouseButtons[] pressedButtons  = GetNewItems(_mouseStateArray, currentState);
            MouseButtons[] releasedButtons = GetMissingItems(_mouseStateArray, currentState);

            //Subtract current values so positive values result in a positive delta.
            Point relativePoint = currentPoint - _mouseStatePoint;
            int   wheelDelta    = eventDataArray[0].Data.WheelDelta;

            _mouseStateWheel = _mouseStateWheel + wheelDelta;


            MouseEventData eventData = new MouseEventData(pressedButtons, releasedButtons, currentState, currentPoint, relativePoint, _mouseStateWheel, wheelDelta);

            //System.Diagnostics.Trace.WriteLine(eventData.ToString());

            if (pressedButtons.Length != 0 || releasedButtons.Length != 0 || relativePoint != Point.Empty || wheelDelta != 0)
            {
                MouseEvent?.Invoke(new MouseEventArgs(eventData));
                returnStatus = true;
            }

            if (pressedButtons.Length != 0)
            {
                MouseDownEvent?.Invoke(new MouseEventArgs(eventData));
            }

            if (releasedButtons.Length != 0)
            {
                MouseUpEvent?.Invoke(new MouseEventArgs(eventData));
            }


            if (relativePoint != Point.Empty)
            {
                MouseMoveEvent?.Invoke(new MouseEventArgs(eventData));
            }

            if (wheelDelta != 0)
            {
                MouseWheelEvent?.Invoke(new MouseEventArgs(eventData));
            }

            _mouseStateArray = currentState;
            return(returnStatus);
        }
 public MouseStateEventData(System.Windows.Forms.MouseEventArgs e, MouseStateEventType t)
 {
     Type = t;
     Data = new MouseEventData(e, t == MouseStateEventType.MouseDown);
 }
 public MouseEventArgs(MouseEventData args)
 {
     MouseData = args;
 }