Example #1
0
        public MouseEvent MouseUp(MouseEventArgs e)
        {
            MouseEvent.MouseInfo mouseInfo = new MouseEvent.MouseInfo(false, false, new TPoint(e.X, e.Y));
            InheritButtonStatesFromPreviousMouseEvent(ref mouseInfo);

            if (e.Button == MouseButtons.Left)
            {
                mouseInfo.leftButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.LUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }
            else if (e.Button == MouseButtons.Middle)
            {
                mouseInfo.middleButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.MUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }
            else if (e.Button == MouseButtons.Right)
            {
                mouseInfo.rightButton = false;
                MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.RUp, mouseInfo, m_previousEvent.Info.position);
                m_previousEvent = mouseEvent;
                return mouseEvent;
            }

            return null;
        }
Example #2
0
        public MouseEvent MouseMove(MouseEventArgs e)
        {
            MouseEvent.MouseInfo mouseInfo = new MouseEvent.MouseInfo(false, false, new TPoint(e.X, e.Y));
            InheritButtonStatesFromPreviousMouseEvent(ref mouseInfo);

            MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.Move, mouseInfo, m_previousEvent.Info.position);
            m_previousEvent = mouseEvent;
            return mouseEvent;
        }
Example #3
0
        public MouseEvent MouseWheel(MouseEventArgs e)
        {
            MouseEvent.MouseInfo mouseInfo = new MouseEvent.MouseInfo(false, false, false, new TPoint(e.X, e.Y), e.Delta);
            InheritButtonStatesFromPreviousMouseEvent(ref mouseInfo);
            MouseEvent mouseEvent = new MouseEvent(MouseEvent.EventState.Wheel, mouseInfo);
            m_previousEvent = mouseEvent;

            return mouseEvent;
        }