al_grab_mouse(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 🌈


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