/// <summary> /// Gets if the mouse button was released in this frame. /// </summary> /// <param name="b">The MouseButton to check.</param> /// <returns>`true` if the mouse button was released, `false` otherwise.</returns> public bool IsButtonReleased(MouseButton b) { return b.GetMappedState(CurrentMouseState) == ButtonState.Released && b.GetMappedState(PreviousMouseState) == ButtonState.Pressed; }
/// <summary> /// Gets if the mouse button is up. /// </summary> /// <param name="b">The MouseButton to check.</param> /// <returns>`true` if the mouse button is up, `false` otherwise.</returns> public bool IsButtonUp(MouseButton b) { return b.GetMappedState(CurrentMouseState) == ButtonState.Released; }
/// <summary> /// Gets if the mouse button was up in the previous frame. /// </summary> /// <param name="b">The MouseButton to check.</param> /// <returns>`true` if the mouse button was up, `false` otherwise.</returns> public bool IsButtonPreviouslyUp(MouseButton b) { return b.GetMappedState(PreviousMouseState) == ButtonState.Released; }
/// <summary> /// Gets if the mouse button was down in the previous frame. /// </summary> /// <param name="b">The MouseButton to check.</param> /// <returns>`true` if the mouse button was down, `false` otherwise.</returns> public bool IsButtonPreviouslyDown(MouseButton b) { return b.GetMappedState(PreviousMouseState) == ButtonState.Pressed; }
/// <summary> /// Gets if the mouse button is down. /// </summary> /// <param name="b">The MouseButton to check.</param> /// <returns>`true` if the mouse button is down, `false` otherwise.</returns> public bool IsButtonDown(MouseButton b) { return b.GetMappedState(CurrentMouseState) == ButtonState.Pressed; }
/// <summary> /// Gets the state for the passed mouse button in the last frame. /// </summary> /// <param name="b">The mouse button to check.</param> /// <returns>The ButtonState for the mouse in the last frame.</returns> public ButtonState GetPreviousButtonState(MouseButton b) { return b.GetMappedState(PreviousMouseState); }
/// <summary> /// Gets the state for the passed mouse button. /// </summary> /// <param name="b">The mouse button to check.</param> /// <returns>The ButtonState for the mouse in this frame.</returns> public ButtonState GetButtonState(MouseButton b) { return b.GetMappedState(CurrentMouseState); }