Exemple #1
0
 private void MouseButtonUp(LowLevelMouseInput input)
 {
     if (_buttonDown)
     {
         _buttonDown = false;
         _startPoint = new Point()
         {
             X = 0, Y = 0
         };
         _overlayPoint = new Point()
         {
             X = 0, Y = 0
         };
         _editState           = OverlayEditState.None;
         _selectedOverlayText = null;
     }
 }
Exemple #2
0
        private void MouseButtonDown(LowLevelMouseInput input)
        {
            Point mousePosition = input.Point;

            if (!_buttonDown)
            {
                _buttonDown = true;

                foreach (var item in _overlayComponent.Overlays)
                {
                    if (item.GetType().IsSubclassOf(typeof(OverlayItemText)))
                    {
                        var textOverlay = (item as OverlayItemText).Overlay;
                        if (textOverlay.IsValidID && textOverlay.Active)
                        {
                            var useMaxWidth  = textOverlay.UseMaxWidth;
                            var useMaxHeight = textOverlay.UseMaxHeight;
                            var x            = textOverlay.X;
                            var y            = textOverlay.Y;
                            var width        = useMaxWidth ? textOverlay.MaxWidth : textOverlay.Width;
                            var height       = useMaxHeight ? textOverlay.MaxHeight : textOverlay.Height;

                            if (mousePosition.X >= x && mousePosition.X <= (x + width) && mousePosition.Y >= y && mousePosition.Y <= (y + height))
                            {
                                _selectedOverlayText = textOverlay;
                                _startPoint          = mousePosition;

                                if ((useMaxWidth || useMaxHeight) && mousePosition.X >= (x + width - 10) && mousePosition.X <= (x + width) && mousePosition.Y >= (y + height - 10) && mousePosition.Y <= (y + height))
                                {
                                    _overlayPoint.X = width;
                                    _overlayPoint.Y = height;

                                    _editState = OverlayEditState.Size;
                                }
                                else
                                {
                                    _overlayPoint.X = _selectedOverlayText.X;
                                    _overlayPoint.Y = _selectedOverlayText.Y;
                                    _editState      = OverlayEditState.Position;
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #3
0
 public MouseHook(KeybinderCore core)
 {
     _core             = core;
     _overlayComponent = core.GetComponent <OverlayComponent>();
     _mouseHookHandle  = IntPtr.Zero;
     _buttonDown       = false;
     _startPoint       = new Point()
     {
         X = 0, Y = 0
     };
     _overlayPoint = new Point()
     {
         X = 0, Y = 0
     };
     _editState           = OverlayEditState.None;
     _selectedOverlayText = null;
     _running             = false;
     _threadId            = 0;
 }