mouse_callback(3)
π mouse_callback(3) π
okay bestie, so this is a page from the Allegro manual (the game programming library, yes THAT Allegro) and it's about mouse_callback β a lil function pointer you get to fill in yourself. group chat, gather round π«Ά
β¨ NAME β¨
mouse_callback β the mouse callback that you specify. it's part of the Allegro game programming library, and it is exactly as niche and exactly as powerful as it sounds π
πΈ SYNOPSIS πΈ
#include <allegro.h>
extern void (*mouse_callback)(int flags);
that's it. that's the whole thing. a function pointer just vibing out there in the open, waiting for you to point it at something π
π¦ DESCRIPTION π¦
so here's the tea, bestie: the interrupt handler calls this thing whenever the mouse moves or whenever one of the buttons changes state. that's the whole job description.
π¨ TWO HARD RULES, no cap: this function must live in locked memory, and it must execute _very_ quickly! like, blink-and-you-missed-it fast. it's running from an interrupt handler, so do not be out here doing side quests in there π
it gets passed the event flags that triggered the call β and those flags are a bitmask containing any of these 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π±οΈMOUSE_FLAG_MOVE_Zπ
β οΈ important caveat, don't skip this one: even if your mouse has more than three buttons, only the first three can be trapped using a callback. the rest of your extra buttons are justβ¦ not invited to this party π
π SEE ALSO π
install_mouse(3)β go read that one next, bestie, it's the prequel π
and that's the whole page, you ate it, periodt π
this lil love letter was brought to you by Allegro, version 4.4.3 β mwah, catch you in the next manpage πππ¦
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms