/// <summary> /// Finds out if a button on the Mouse has been stroked. /// </summary> /// <param name="button">The button to check.</param> /// <returns>The result of the check.</returns> public static bool IsButtonStroked(MouseBtns button) { if (mouse != null) { return(mouse.IsButtonStroked(button)); } else { return(false); } }
/// <summary> /// A check to see if a mouse button has been stroked. /// </summary> /// <param name="button">The button to check.</param> /// <returns>The result of the check.</returns> public bool IsButtonStroked(MouseBtns button) { if (IsButtonReleased(button, prevState) && IsButtonPressed(button, currentState)) { return(true); } else { return(false); } }
public Entry(CmdTypes cmdType, string keys, int period, MouseBtns btn, bool repeat, string seperator) { Id = Counter; Counter++; this.CmdType = cmdType; this.Keys = keys; this.MouseBtn = btn; this.Repeat = repeat; this.Seperator = seperator; }
ButtonState GetBtnState(MouseBtns btn, MouseState state) { if (btn == MouseBtns.Left) { return(state.LeftButton); } else if (btn == MouseBtns.Right) { return(state.RightButton); } else if (btn == MouseBtns.Middle) { return(state.MiddleButton); } else if (btn == MouseBtns.Alt1) { return(state.XButton1); } else { return(state.XButton2); } }
bool IsButtonReleased(MouseBtns button, MouseState state) { return(GetBtnState(button, state) == ButtonState.Released ? true : false); }
/// <summary> /// A check to see if a mouse button has being released. /// </summary> /// <param name="button">The button to check.</param> /// <returns>The result of the check.</returns> public bool IsButtonReleased(MouseBtns button) { return(GetBtnState(button, currentState) == ButtonState.Released ? true : false); }
public Entry(MouseBtns btn) : this(CmdTypes.MouseClick, null, 0, btn, false, null) { }