Esempio n. 1
0
 void _hook_OnMouseActivity(object sender, CraftSynth.BuildingBlocks.WindowsNT.UserActivityHookNamespace.MouseEventArgsFull e)
 {
     if (this.OnActivity != null)
     {
         this.OnActivity.Invoke();
     }
 }
Esempio n. 2
0
        void _hook_OnMouseActivity(object sender, CraftSynth.BuildingBlocks.WindowsNT.UserActivityHookNamespace.MouseEventArgsFull e)
        {
            if (this._buttonLeftPressed)
            {
                if (!this._dragStarted &&
                    (
                        e.X - this._dragStartX > 5 || e.X - this._dragStartX < -5 ||
                        e.Y - this._dragStartY > 5 || e.Y - this._dragStartY < -5
                    )
                    )
                {
                    this._dragStarted = true;
                }
            }


            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                if (!e.IsReleased)
                {
                    if (!this._buttonLeftPressed)
                    {
                        this._buttonLeftPressed = true;
                        this._dragStartX        = e.X;
                        this._dragStartY        = e.Y;
                    }
                }
                else
                if (e.IsReleased)
                {
                    this._buttonLeftPressed = false;
                    if (!this._chanceForDoubleClickActive)
                    {
                        this._chanceForDoubleClickActive = true;
                        this._leftMouseDoubleClickTimer.Change(1000, Timeout.Infinite);
                    }
                    else
                    {
                        this._chanceForDoubleClickActive = false;
                        this._leftMouseDoubleClickTimer.Change(Timeout.Infinite, Timeout.Infinite);
                        this.Grab();
                    }

                    if (this._dragStarted)
                    {
                        this._dragStarted = false;
                        this.Grab();
                    }

                    CraftSynth.BuildingBlocks.WindowsNT.WindowsMessage.SendCustomMessage(this._targetWindowHandler, 2, 0, 0);
                }
            }
        }