mouse_callback(3alleg4)
π NAME π
mouse_callback β the user specified mouse callback, bestie. It's part of the Allegro game programming library. β¨
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern void (*mouse_callback)(int flags);
π¦ DESCRIPTION π¦
okay so listen. This function gets called by the interrupt handler whenever the mouse moves or whenever one of the buttons changes state. That's it, that's the whole job. ππ
π¨ MAJOR WARNING BESTIE π¨ This function must be in locked memory, and it must execute _very_ quickly! Like, blink-and-you-miss-it fast. No cap. Do not be doing cute little side quests in here. π
It gets passed the event flags that triggered the call β that's a bitmask, and it can contain any of these:
MOUSE_FLAG_MOVEMOUSE_FLAG_LEFT_DOWNMOUSE_FLAG_LEFT_UPMOUSE_FLAG_RIGHT_DOWNMOUSE_FLAG_RIGHT_UPMOUSE_FLAG_MIDDLE_DOWNMOUSE_FLAG_MIDDLE_UPMOUSE_FLAG_MOVE_Z
and that's the whole list, periodt. π
π lowkey important heads up: even if the mouse has more than three buttons, only the first three can be trapped using a callback. The rest? Not invited to the party. π
π SEE ALSO π
install_mouse(3alleg4)β go read that one too, it's giving main character energy π«Ά
mwah π this page came to you from Allegro version 4.4.3 β that's the manual page mouse_callback(3alleg4), and yes she ate. πβπ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms