al_grab_mouse(3alleg5)
β¨ al_grab_mouse β¨
okay so bestie, we're in the Allegro 5 API manual rn and this one is literally so handy β it's al_grab_mouse, and it's giving "mouse jail but make it cute" ππ
π SYNOPSIS π
#include <allegro5/allegro.h>
bool al_grab_mouse(ALLEGRO_DISPLAY *display)
π DESCRIPTION π
So what this does is confine the mouse cursor to the given display. That's the whole vibe. The cursor gets locked in there like it's on house arrest π
Real talk though: the mouse cursor can only be confined to one display at a time. One. Singular. That's the rule, no cap.
It returns true if it worked, and false if it didn't. Simple as that π
β οΈ but listen β do NOT assume the cursor is gonna stay confined until you call al_ungrab_mouse(3alleg5). It might lose that confined status at any time for other reasons. Fr fr. Don't build your whole life around it staying put π
Note: not yet implemented on Mac OS X. π sorry apple girlies, it's just not there yet.
π SEE ALSO π
al_ungrab_mouse(3alleg5)β the one that lets the mouse go free π¦
mwah π that's the page, you ate it, go confine some cursors responsibly. this was the Allegro reference manual talking, al_grab_mouse(3alleg5), and yeah the date/version lives in that footer energy β consider yourself signed off on, bestie π«Άπ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms