Пример #1
0
 protected override void OnMouseUp(EventArgsMouse e)
 {
     addEvent(new InputEventM(MouseEvent.Up, e));
     if (_mouseIsDragging)
     {
         addEvent(new InputEventM(MouseEvent.DragEnd, e));
         _mouseIsDragging = false;
     }
     else
     {
         if (!Utility.IsPointThisDistanceAway(_lastMouseDown.Position, e.Position, MouseClickMaxDelta))
         {
             if ((ClientVars.EngineVars.TheTime - _lastMouseClickTime <= ClientVars.EngineVars.SecondsForDoubleClick))
             {
                 _lastMouseClickTime = 0f;
                 addEvent(new InputEventM(MouseEvent.DoubleClick, e));
             }
             else
             {
                 _lastMouseClickTime = ClientVars.EngineVars.TheTime;
                 addEvent(new InputEventM(MouseEvent.Click, e));
             }
         }
     }
     _lastMouseDown = null;
 }
Пример #2
0
 protected override void OnMouseWheel(EventArgsMouse e)
 {
     addEvent(new InputEventM(MouseEvent.WheelScroll, e));
 }
Пример #3
0
 protected override void OnMouseDown(EventArgsMouse e)
 {
     _lastMouseDown = new InputEventM(MouseEvent.Down, e);
     _lastMouseDownTime = ClientVars.EngineVars.TheTime;
     addEvent(_lastMouseDown);
 }
Пример #4
0
 protected override void OnMouseMove(EventArgsMouse e)
 {
     addEvent(new InputEventM(MouseEvent.Move, e));
     if (!_mouseIsDragging && _lastMouseDown != null)
     {
         if (Utility.IsPointThisDistanceAway(_lastMouseDown.Position, e.Position, MouseDragBeginDistance))
         {
             addEvent(new InputEventM(MouseEvent.DragBegin, e));
             _mouseIsDragging = true;
         }
     }
 }
Пример #5
0
 public InputEventM(MouseEvent eventType, EventArgsMouse args)
     : base(args)
 {
     _eventType = eventType;
 }
Пример #6
0
 /// <summary>
 /// Raises the MouseWheel event. Override this method to add code to handle when a mouse wheel is turned
 /// </summary>
 /// <param name="e">EventArgsMouse for the MouseWheel event</param>
 protected virtual void OnMouseWheel(EventArgsMouse e)
 {
 }
Пример #7
0
 /// <summary>
 /// Raises the MouseUp event. Override this method to add code to handle when a mouse button is released
 /// </summary>
 /// <param name="e">EventArgsMouse for the MouseUp event</param>
 protected virtual void OnMouseUp(EventArgsMouse e)
 {
 }
Пример #8
0
 /// <summary>
 /// Raises the MouseMove event. Override this method to add code to handle when the mouse is moved
 /// </summary>
 /// <param name="e">EventArgsMouse for the MouseMove event</param>
 protected virtual void OnMouseMove(EventArgsMouse e)
 {
 }
Пример #9
0
 /// <summary>
 /// Raises the MouseDown event. Override this method to add code to handle when a mouse button is pressed
 /// </summary>
 /// <param name="e">EventArgsMouse for the MouseDown event</param>
 protected virtual void OnMouseDown(EventArgsMouse e)
 {
 }