---
name: "mouse_callback"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mouse_callback/3alleg4"
---

# mouse\_callback(3alleg4)

User specified mouse callback. Allegro game programming library.

## NAME

mouse\_callback - User specified mouse callback. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**extern void (\*mouse\_callback)(int flags);**

## DESCRIPTION

Called by the interrupt handler whenever the mouse moves or one of the  buttons changes state. This function must be in locked memory, and must  execute \_very\_ quickly! It is passed the event flags that triggered the  call, which is a bitmask containing any of the values MOUSE\_FLAG\_MOVE,  MOUSE\_FLAG\_LEFT\_DOWN, MOUSE\_FLAG\_LEFT\_UP, MOUSE\_FLAG\_RIGHT\_DOWN,  MOUSE\_FLAG\_RIGHT\_UP, MOUSE\_FLAG\_MIDDLE\_DOWN, MOUSE\_FLAG\_MIDDLE\_UP, and  MOUSE\_FLAG\_MOVE\_Z. Note that even if the mouse has more than three buttons, only the first three can be trapped using a callback.

## SEE ALSO

**install\_mouse**(3alleg4)
