public bool IsButtonPressed(Mouse.Button button) { return(IsButtonDown(button) && WasButtonUp(button)); }
/// <summary> /// If the button has just been pressed. /// </summary> /// <param name="but"> /// The index of the button. /// </param> /// <returns> /// True if the button index is valid and the button has just been pressed, otherwise false. /// </returns> public bool JustPressed(Mouse.Button but) { return(m_current.IsPressed(but) && !m_last.IsPressed(but)); }
private bool CheckButton(Mouse.Button button) { return(Mouse.IsButtonPressed(button)); }
public static bool IsReleased(Mouse.Button button) { return(isButtonReleased[(int)button]); }
static void OnMouseRelease(object sender, MouseButtonEventArgs e) { RenderWindow window = (RenderWindow)sender; if (UsingButton != null) { UsingButton.Picked(); //UsingButton = null; } else { State[InState].HandleMouse(e.Button); LastMouseType = Mouse.Button.Right; } }
public override bool HandleMouseClick(Vector2f mousePos, Mouse.Button button) { return(GetBounds().Contains(mousePos.X, mousePos.Y)); }
public static bool IsDown(Mouse.Button button) { return(isButtonDown[(int)button]); }
public bool IsMouseReleased(Mouse.Button button) { return(mouseReleased.Contains(button)); }
internal void Update() { // Move all keys from keyPressed to keyHolds for (int i = 0; i < keyPressed.Count; i++) { keyHeld.Add(keyPressed[i]); } keyPressed.Clear(); keyReleased.Clear(); // Clear all released key for (int i = 0; i < allKeys.Length; i++) { Keyboard.Key key = allKeys[i]; // If key is pressed if (Keyboard.IsKeyPressed(key)) { // If key was not previously held if (!keyHeld.Contains(key)) { // Mark this key as just pressed keyPressed.Add(key); } } else // Key not pressed { // If this key is marked as pressed if (keyHeld.Contains(key)) { // Remove it and mark it as released keyHeld.Remove(key); keyReleased.Add(key); } } } // Move all keys from keyPressed to keyHolds for (int i = 0; i < mousePressed.Count; i++) { mouseHeld.Add(mousePressed[i]); } mousePressed.Clear(); mouseReleased.Clear(); // Clear all released key for (int i = 0; i < allMouseButtons.Length; i++) { Mouse.Button button = allMouseButtons[i]; // If key is pressed if (Mouse.IsButtonPressed(button)) { // If key was not previously held if (!mouseHeld.Contains(button)) { // Mark this key as just pressed mousePressed.Add(button); } } else // Key not pressed { // If this key is marked as pressed if (mouseHeld.Contains(button)) { // Remove it and mark it as released mouseHeld.Remove(button); mouseReleased.Add(button); } } } }
public UIClickedEventArgs(UIElement element, Mouse.Button button) { this.element = element; this.button = button; }
public bool IsMouseDown(Mouse.Button button) { return(mouseHeld.Contains(button) || mousePressed.Contains(button)); }
public override void OnClick(int x, int y, Mouse.Button button) { Program.TowerGUI.visible = true; Program.TowerGUI.Selected = this; base.OnClick(x, y, button); }
public override void OnClick(int x, int y, Mouse.Button button) { }
public MouseAttackScript(Mouse.Button left, double attackInterval) { this._left = left; _attackInterval = attackInterval; }
public MouseButtonEventArgs(Mouse.Button button, Vector2? position) : base(position) { Button = button; }
public MouseButtonInputArgs(Mouse.Button button, bool pressed, int x, int y) { Button = button; Pressed = pressed; screenPosition = new Vector2i(x, y); }
public MouseKey( Mouse.Button b, bool f ) { button = b; fReleased = f; }
public MouseEvent(MouseStateChange type_, Mouse.Button button_, int wheelDelta_, Vector2f position_, Vector2f positionDelta_) : base(EventType.MouseEvent) { StateChange = type_; Button = button_; WheelDelta = wheelDelta_; Position = position_; PositionDelta = positionDelta_; }
public static bool isMouseUp(Mouse.Button button) { return(mouseButtonsDown.TryGetValue(button, out bool ret) ? ret : true); }
public ClickEvent(Mouse.Button button_) : base(EventType.ClickEvent) { Button = button_; }
public static bool IsPressed(Mouse.Button button) { return(isButtonPressed[(int)button]); }
// ALL the parameters! public MouseButtonEventArgs(Mouse.Button button, Vector2 position) : base(position) { Button = button; }
public MouseCommand(Mouse.Button button, bool pressed, Vector2i location) { Button = button; Pressed = pressed; Location = location; }
// ALL the parameters! public MouseButtonEventArgs(Mouse.Button button, ScreenCoordinates position) : base(position) { Button = button; }
/// <summary> /// If the button is pressed. /// </summary> /// <param name="but"> /// The index of the button. /// </param> /// <returns> /// True if the button index is valid and the button is pressed, otherwise false. /// </returns> public bool IsPressed(Mouse.Button but) { return(m_current.IsPressed(but)); }
public bool IsButtonHold(GameLoop loop, Mouse.Button btn) => rectangle.GetGlobalBounds().Contains(Mouse.GetPosition(loop.window).X, Mouse.GetPosition(loop.window).Y) && Mouse.IsButtonPressed(btn);
/// <summary> /// If the button has just been released. /// </summary> /// <param name="but"> /// The index of the button. /// </param> /// <returns> /// True if the button index is valid and the button has just been released, otherwise false. /// </returns> public bool JustReleased(Mouse.Button but) { return(!m_current.IsPressed(but) && m_last.IsPressed(but)); }
public MouseButtonEventArgs(Mouse.Button button, Vector2i position) { Button = button; Position = position; }
public bool IsButtonReleased(Mouse.Button button) { return(WasButtonDown(button) && IsButtonUp(button)); }
public static KeyState GetMouseState(Mouse.Button button) { return(mouse[button]); }
//////////////////////////////////////////////////////////// /// <summary> /// Construct the mouse button arguments from a mouse button event /// </summary> /// <param name="e">Mouse button event</param> //////////////////////////////////////////////////////////// public MouseButtonEventArgs(MouseButtonEvent e) { Button = e.Button; X = e.X; Y = e.Y; }
public static bool WasJustReleased(Mouse.Button button) { return(GetMouseState(button) == KeyState.JustReleased); }
public InputKey(Mouse.Button mouseButton) { msButton = mouseButton; }
public static bool IsMouseDown(Mouse.Button button) { mouseButtonsDown.TryGetValue(button, out bool ret); return(ret); }
public MouseEventHandler(Mouse.Button button, List<InputEvent> futureEvents) : base(futureEvents) { m_button = button; }
public override void OnClick(int x, int y, Mouse.Button button) { base.OnClick(x, y, button); }