Пример #1
0
 private void _mHookEventRaised(object sender, MouseEventArgs e)
 {
     if (_mouseEvents.ContainsKey(e.Message))
         _mouseEvents[e.Message] += e.Message == MouseMessage.WM_MOUSEMOVE ? e.MovePath : 1;
     else
         _mouseEvents.Add(e.Message, e.Message == MouseMessage.WM_MOUSEMOVE ? e.MovePath : 1);
 }
Пример #2
0
 private void OnEventRaised(MouseEventArgs e)
 {
     if (EventRaised != null)
         EventRaised(this, e);
 }
Пример #3
0
        private void _mHookEventRaised(object sender, MouseEventArgs e)
        {
            if (e.Message == MouseMessage.WM_MOUSEMOVE)
                if (_mouseMove.Length == 0) {
                    _mouseMove[0, 0] = e.Point.X;
                    _mouseMove[0, 1] = e.Point.Y;
                    _mouseMoveLength = 0;
                } else {
                    _mouseMoveLength += (ulong)Math.Sqrt(Math.Pow(e.Point.X - _mouseMove[0, 0], 2) + Math.Pow(e.Point.Y - _mouseMove[0, 1], 2)) / 38; // magic 38!
                    _mouseMove[0, 0] = e.Point.X;
                    _mouseMove[0, 1] = e.Point.Y;
                }

            if (_mouseEvents.ContainsKey(e.Message))
                _mouseEvents[e.Message] += 1;
            else
                _mouseEvents.Add(e.Message, 1);
        }