ALLEGRO_KEYBOARD_STATE(3alleg5)
β¨ 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 toNULL. 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
- 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