Ejemplo n.º 1
0
                public override int GetHashCode()
                {
                    int hash = 1;

                    if (X != 0)
                    {
                        hash ^= X.GetHashCode();
                    }
                    if (Y != 0)
                    {
                        hash ^= Y.GetHashCode();
                    }
                    if (ActionType != 0)
                    {
                        hash ^= ActionType.GetHashCode();
                    }
                    if (WheelRotation != 0)
                    {
                        hash ^= WheelRotation.GetHashCode();
                    }
                    if (RelativePosition != false)
                    {
                        hash ^= RelativePosition.GetHashCode();
                    }
                    if (MappedToVirtualDesktop != false)
                    {
                        hash ^= MappedToVirtualDesktop.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        hash ^= _unknownFields.GetHashCode();
                    }
                    return(hash);
                }
Ejemplo n.º 2
0
            bool MouseWheelEvent(GlobalMouseHookEventArgs e)
            {
                MousePosition mousePosition = new MousePosition(e.MouseData.pt.x, e.MouseData.pt.y);

                /* Compared to the other events, we need to find the rotation of the scroll wheel (wheel delta). Unfortunately, the low level mouse event doesn't pass it as a human readable value.
                 * Instead, it is passed on as a high order word of the e.mouseData.mouseData value. We have to retrieve that High Order Word by using a helper function called GetSignedHWord.*/
                WheelRotation wheelRotation = (WheelRotation)(Helper.GetSignedHWORD(e.MouseData.mouseData)); //The Wheel Delta will always be either 120 for forwards movement and -120 for backwards movement which is already declared on the WheelRotation enum. All we have to do is cast the Wheel Delta to WheelRotation.


                GlobalMouseEventArgs globalMouseEventArgs = new GlobalMouseEventArgs(GHMouseButtons.None, mousePosition, wheelRotation);

                return(CallEvent(OnMouseWheelScroll, globalMouseEventArgs));
            }
Ejemplo n.º 3
0
 public GlobalMouseEventArgs(GHMouseButtons _button, MousePosition _pos, WheelRotation _wheelRot = WheelRotation.None)
 {
     Button        = _button;
     PointerPos    = _pos;
     wheelRotation = _wheelRot;
 }