private Mouse ListenForControl(BindingListenOptions listenOptions)
 {
     if (listenOptions.IncludeMouseButtons)
     {
         for (Mouse mouse = Mouse.None; mouse <= Mouse.Button9; mouse++)
         {
             if (MouseBindingSource.ButtonIsPressed(mouse))
             {
                 return(mouse);
             }
         }
     }
     if (listenOptions.IncludeMouseScrollWheel)
     {
         if (MouseBindingSource.NegativeScrollWheelIsActive(ScrollWheelThreshold))
         {
             return(Mouse.NegativeScrollWheel);
         }
         if (MouseBindingSource.PositiveScrollWheelIsActive(ScrollWheelThreshold))
         {
             return(Mouse.PositiveScrollWheel);
         }
     }
     return(Mouse.None);
 }
        Mouse ListenForControl(BindingListenOptions listenOptions)
        {
            if (listenOptions.IncludeMouseButtons)
            {
                for (var control = Mouse.None; control <= Mouse.Button9; control++)
                {
                    if (MouseBindingSource.ButtonIsPressed(control))
                    {
                        return(control);
                    }
                }
            }

            if (listenOptions.IncludeMouseScrollWheel)
            {
                if (MouseBindingSource.NegativeScrollWheelIsActive(ScrollWheelThreshold))
                {
                    return(Mouse.NegativeScrollWheel);
                }

                if (MouseBindingSource.PositiveScrollWheelIsActive(ScrollWheelThreshold))
                {
                    return(Mouse.PositiveScrollWheel);
                }
            }

            return(Mouse.None);
        }
        private bool IsPressed(Mouse control)
        {
            switch (control)
            {
            case Mouse.NegativeScrollWheel:
                return(MouseBindingSource.NegativeScrollWheelIsActive(ScrollWheelThreshold));

            case Mouse.PositiveScrollWheel:
                return(MouseBindingSource.PositiveScrollWheelIsActive(ScrollWheelThreshold));

            default:
                return(MouseBindingSource.ButtonIsPressed(control));
            }
        }