---
name: "al_mouse_button_down"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_mouse_button_down"
---

# al\_mouse\_button\_down(3)

Allegro 5 API

## NAME

al\_mouse\_button\_down - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  bool al_mouse_button_down(const ALLEGRO_MOUSE_STATE *state, int button)
  ```

## DESCRIPTION

Return true if the mouse button specified was held down in the state specified.

Unlike most things, the first mouse button is numbered 1. As a convenience, the constants ALLEGRO\_MOUSE\_BUTTON\_LEFT, ALLEGRO\_MOUSE\_BUTTON\_RIGHT, ALLEGRO\_MOUSE\_BUTTON\_MIDDLE are provided. However, depending on the hardware there may be more or fewer mouse buttons. You can check [al\_get\_mouse\_num\_buttons(3)](/al_get_mouse_num_buttons/3.md) if you want to be sure.

## SEE ALSO

[ALLEGRO\_MOUSE\_STATE(3)](/ALLEGRO_MOUSE_STATE/3.md), [al\_get\_mouse\_state(3)](/al_get_mouse_state/3.md), [al\_get\_mouse\_state\_axis(3)](/al_get_mouse_state_axis/3.md)
