gui_mouse_x(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ gui_mouse_x(3) ✨

okay bestie, gather round, because this one is from the Allegro manual and it's literally the little hook squad that lets the GUI peek at your mouse πŸ­πŸ’–


🌸 NAME 🌸

gui_mouse_x, gui_mouse_y, gui_mouse_z, gui_mouse_b β€” the hook functions the GUI routines use to get at the mouse state, bestie. Allegro game programming library, no cap. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

extern int (*gui_mouse_x)();

extern int (*gui_mouse_y)();

extern int (*gui_mouse_z)();

extern int (*gui_mouse_b)();

like, four function pointers, all extern, all returning int, all taking no args. periodt. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so these are hook functions, right? and the GUI routines call them whenever they need to access the mouse state. that's the whole job. iconic behaviour honestly. ✨

by default they just return copies of the mouse_x, mouse_y, mouse_z, and mouse_b variables β€” that's it, that's the vibe. 🌈

but here's where it gets fun πŸ‘€ β€” they could be used to offset or scale the mouse position, or to read input from a completely different source entirely. like, go off, honestly. main character energy fr fr. πŸ’œ

ngl the fact that you can swap the entire input source out from under the GUI is lowkey unhinged and I'm obsessed with it 🫢

and that's the whole page, babes! this lil beauty is from Allegro version 4.4.3 and it lives at gui_mouse_x(3) β€” mwah, slay, go write something cute πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from