Beispiel #1
0
        private static ButtonState Action2Button(MouseState state, Cv_MouseAction action)
        {
            switch (action)
            {
            case Cv_MouseAction.Left:
                return(state.LeftButton);

            case Cv_MouseAction.Middle:
                return(state.MiddleButton);

            case Cv_MouseAction.Right:
                return(state.RightButton);

            case Cv_MouseAction.X1:
                return(state.XButton1);

            case Cv_MouseAction.X2:
                return(state.XButton2);

            default:
                return(ButtonState.Released);
            }
        }
Beispiel #2
0
 private bool MouseButtonPressed(Cv_MouseAction action)
 {
     //Determine whether the parsed button is pressed or not
     return(Action2Button(m_MouseState, action) == ButtonState.Pressed && Action2Button(m_LastMouseState, action) == ButtonState.Released);
 }
Beispiel #3
0
 private bool MouseButtonDown(Cv_MouseAction action)
 {
     //Determine whether a button is currently down
     return(Action2Button(m_MouseState, action) == ButtonState.Pressed);
 }
Beispiel #4
0
 public void BindCommand(Cv_Player player, string command, Cv_MouseAction button)
 {
     m_BindedMouseActions[player - 1][command] = button;
 }