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); } }
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); }
private bool MouseButtonDown(Cv_MouseAction action) { //Determine whether a button is currently down return(Action2Button(m_MouseState, action) == ButtonState.Pressed); }
public void BindCommand(Cv_Player player, string command, Cv_MouseAction button) { m_BindedMouseActions[player - 1][command] = button; }