ALLEGRO_MOUSE_STATE(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– ALLEGRO_MOUSE_STATE πŸ’–

okay bestie so this is a page from the Allegro 5 API manual β€” like, the whole Allegro reference manual vibe β€” and today we're talking about ALLEGRO_MOUSE_STATE. yes, the mouse. the little guy you're holding. we love him. 🐭✨


🌸 SYNOPSIS 🌸

#include <allegro5/allegro.h>

typedef struct ALLEGRO_MOUSE_STATE ALLEGRO_MOUSE_STATE;

that's it, that's the whole vibe. you include the header, you get the struct type. iconic. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so ALLEGRO_MOUSE_STATE is a struct, and all its fields are public and read only β€” meaning you can look πŸ‘€ but you cannot touch, no cap. here's the whole lineup, one by one, nothing skipped, periodt:

  • x β€” the mouse x position. literally where your cursor is, horizontally. πŸ“
  • y β€” the mouse y position. and vertically, obviously. together they're a whole coordinate moment.
  • w, z β€” the mouse wheel position, aka the 2D ball. two fields, one wheel situation. 🎑
  • display β€” the display the mouse is on. and listen: the coordinates are relative to this display, so don't go mixing them up with some other screen, bestie. πŸ–₯️
  • buttons β€” the mouse buttons bitfield. okay so this one's giving bitwise, so let me spell it out:
    • the zeroth bit is set if the primary mouse button is held down πŸ’–
    • the first bit is set if the secondary mouse button is held down πŸ’–
    • and so on. yes, "and so on." that's the whole rule. if you know you know. iykyk. 🫢
  • pressure β€” pressure, ranging from 0.0 to 1.0. it's giving touchscreen, it's giving stylus, it's giving how hard are you pressing energy. πŸŽ€
not me reminding you again that every single one of these is read only β€” these are fields you read from, not fields you write to, and that is not a suggestion, that is the spec. πŸ™ˆ

🌈 SEE ALSO 🌈

go read these next, they're all part of the same friend group:


and that's the whole page, bestie, you ate it. πŸ’…βœ¨ this lil love letter came to you straight from the Allegro reference manual, filed under ALLEGRO_MOUSE_STATE(3alleg5), and we're signing off with all the sparkles. go forth and read your mouse state responsibly. mwah. πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from