示例#1
0
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            base.OnMouseWheel(e);

            if (e.Delta > 0)
            {
                OnMouseWheelUpwards?.Invoke(e);
            }
            else if (e.Delta < 0)
            {
                OnMouseWheelDownwards?.Invoke(e);
            }
        }
示例#2
0
        protected override void OnMouseWheel(MouseEventArgs e)
        {
            base.OnMouseWheel(e);

            if (e.Delta > 0)
            {
                OnMouseWheelUpwards?.Invoke(e);
            }
            else if (e.Delta < 0)
            {
                OnMouseWheelDownwards?.Invoke(e);
            }

            try
            {
                if (!designMode)
                {
                    Sdl.Event evt = GetWheelEvent(e.Delta);
                    Sdl.PushEvent(out evt);
                }
            }
            catch { }
        }