ureadkey(3)
β¨ ureadkey(3) β¨
okay bestie, pull up a chair, we're doing the Allegro manual thing π this one's about ureadkey(3), aka the girl who actually reads your Unicode keystrokes instead of just squinting at ASCII like it's 1994.
NAME
ureadkey β returns the next unicode character from the keyboard buffer. it's part of the Allegro game programming library, no cap π
SYNOPSIS
#include <allegro.h>
int ureadkey(int *scancode);
DESCRIPTION
so here's the tea β ureadkey() hands you the next character from the keyboard buffer, and it does it in Unicode format. fancy, I know. π
if the buffer is empty? she simply waits. sits there. patient queen. doesn't return until a key is actually pressed. π¦
wanna know if there's stuff already queued up before you commit to a blocking read? check with keypressed(). π
the return value is the Unicode value of the key. and that pointer argument? if it's not NULL, it gets set to the scancode. π―
and here's the part where she truly ate: unlike readkey(), this function can return character values greater than 255. lowercase behavior, uppercase capability. periodt. β¨
example time, look at her:
int val, scancode;
...
val = ureadkey(&scancode);
if (val == 0x00F1)
allegro_message("You pressed n with tilde\n");
if (val == 0x00DF)
allegro_message("You pressed sharp s\n");
β οΈ DOS besties listen UP β οΈ on DOS you must specify a custom keyboard map (like the ones you'll find inkeyboard.dat), usually with the help of a configuration file that specifies the language mapping β that's thekeyboardvariable, in thesystemsection ofallegro.cfg. skip that and you get the default US keyboard mapping. not a vibe, fr fr. π
also, you should be able to find Unicode character maps at http://www.unicode.org/. go look, it's giving reference material π
SEE ALSO
πΈ and that's the whole page, bestie πΈ this was Allegro, version 4.4.3 β mwah, love that for us. now go read some Unicode and slay ππ«Άπ
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms