---
name: "al_mouse_button_down"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_mouse_button_down/3alleg5"
---

# al\_mouse\_button\_down(3alleg5)

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(3alleg5) if you want to be sure.

## SEE ALSO

ALLEGRO\_MOUSE\_STATE(3alleg5), al\_get\_mouse\_state(3alleg5), al\_get\_mouse\_state\_axis(3alleg5)
