ALLEGRO_KEYBOARD_STATE(3alleg5)

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

✨ ALLEGRO_KEYBOARD_STATE ✨

okay bestie, welcome to the Allegro 5 API πŸ’– this one's short and sweet, don't stress.


🌸 NAME 🌸

ALLEGRO_KEYBOARD_STATE β€” she's a whole struct, and she's about to tell you what your keyboard was doing at one specific moment in time πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro.h>

typedef struct ALLEGRO_KEYBOARD_STATE ALLEGRO_KEYBOARD_STATE;

πŸ’… DESCRIPTION πŸ’…

So here's the tea β˜• β€” this struct is literally a snapshot of a keyboard's state at one particular instant. Like, a freeze-frame. A little polaroid of your keys at time t. πŸ“Έβœ¨

It holds the following publicly readable fields:

  • display β€” points to the display that had keyboard focus at the time the state was saved. And if no display was focused? Then it points to NULL. That's it, that's the field. πŸ™ˆ
⚠️ real talk, queen: you cannot read the state of keys directly from this thing. Not even a little. Do not try it. Instead you use the function al_key_down(3alleg5) β€” that's the one who does the actual key-checking, she's the main character here, this struct is just the storage unit. πŸ‘‘

🫢 SEE ALSO 🫢


and that's the whole page, bestie!! 🌈 no cap, sometimes the docs are just this short and that's iconic of them. this was the Allegro reference manual, living in the 3alleg5 section, and she ate πŸ’…βœ¨ mwah, go check your keys with al_key_down and slay πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from