CarpMuffin.Input.MouseManager.IsButton C# (CSharp) Method

IsButton() private method

private IsButton ( MouseButtons button, ButtonState currentState, ButtonState previousState ) : bool
button MouseButtons
currentState ButtonState
previousState ButtonState
return bool
        private bool IsButton(MouseButtons button, ButtonState currentState, ButtonState previousState)
        {
            switch (button)
            {
                case MouseButtons.Left: return CurrentState.LeftButton == currentState && PreviousState.LeftButton == previousState;
                case MouseButtons.Middle: return CurrentState.MiddleButton == currentState && PreviousState.MiddleButton == previousState;
                case MouseButtons.Right: return CurrentState.RightButton == currentState && PreviousState.RightButton == previousState;
                case MouseButtons.XButton1: return CurrentState.XButton1 == currentState && PreviousState.XButton1 == previousState;
                case MouseButtons.XButton2: return CurrentState.XButton2 == currentState && PreviousState.XButton2 == previousState;
            }
            return false;
        }