Exemplo n.º 1
0
        protected override void OnMouseWheel(MouseEventArgs mea)
        {
            // (i.e., there won't be one--NullReferenceException)
            if (!DesignMode && IsConnected)
            {
                Point current = PointToClient(MousePosition);
                byte  mask    = 0;

                // mouse was scrolled forward
                if (mea.Delta > 0)
                {
                    mask += 8;
                }
                else if (mea.Delta < 0)                     // mouse was scrolled backwards
                {
                    mask += 16;
                }

                vnc.WritePointerEvent(mask, desktopPolicy.GetMouseMovePoint(current));
            }
            base.OnMouseWheel(mea);
        }
        // TODO: Perhaps overload UpdateRemotePointer to take a flag indicating if mousescroll has occured??
        protected override void OnMouseWheel(MouseEventArgs mea)
        {
            // HACK: this check insures that while in DesignMode, no messages are sent to a VNC Host
            // (i.e., there won't be one--NullReferenceException)
            if (!DesignMode && IsConnected)
            {
                var  current = PointToClient(MousePosition);
                byte mask    = 0;

                // mouse was scrolled forward
                if (mea.Delta > 0)
                {
                    mask += 8;
                }
                else if (mea.Delta < 0)
                {
                    mask += 16;
                }

                vnc.WritePointerEvent(mask, desktopPolicy.GetMouseMovePoint(current));
            }
            base.OnMouseWheel(mea);
        }