exkeys(3)
π exkeys(3) β the Allegro manual's cutest keyboard tour π
okay bestie, so this is exkeys(3) from the Allegro manual β and it's literally the manual page for an example program that teaches you every single way to get input from the keyboard. no cap. we're going through all of them. π
β¨ NAME β¨
exkeys β how to get input from the keyboard in different ways. it's part of the Allegro game programming library. π
πΈ SYNOPSIS πΈ
#include <allegro.h>
Example exkeys
like, that's the whole vibe. one include, one example. iconic. β¨
π¦ DESCRIPTION π¦
so this program is a whole demo of how to access the keyboard, and it's broken up into stages, like a lil glow-up montage for input handling. π
- First part β shows the basic use of
readkey(). the starter pack. πΌ - Second part β shows how to extract the ASCII value. yes, the actual character, bestie. π€
- Third part β next come the scan codes. π
- Fourth test β detects modifier keys like alt or shift. those sneaky lil guys. π
- Fifth test β this one requires some focus to be passed. like, actually pay attention for this one, fr fr. π
- Final step β shows how to use the global key array to read simultaneous key presses. yes, multiple keys at once. main character multitasking energy. π
and then β plot twist β the last method to detect key presses is keyboard callbacks. π
this is demonstrated by installing a keyboard callback, which marks all pressed keys by drawing to a grid.
so it literally draws a lil grid and lights up every key you press. obsessed. that's the demo. periodt. π
π«Ά SEE ALSO π«Ά
okay so if you wanna go deeper, here's the whole squad, no one left behind:
END_OF_FUNCTION(3),END_OF_MAIN(3),LOCK_FUNCTION(3),SCREEN_H(3),SCREEN_W(3),acquire_screen(3),allegro_error(3),allegro_init(3),allegro_message(3),blit(3),clear_keybuf(3),clear_to_color(3),desktop_palette(3),font(3),install_keyboard(3),install_timer(3),key(3),key_shifts(3),keyboard_lowlevel_callback(3),keypressed(3),makecol(3),readkey(3),rectfill(3),release_screen(3),rest(3),scancode_to_name(3),screen(3),set_gfx_mode(3),set_palette(3),textout_ex(3),textprintf_centre_ex(3),textprintf_ex(3),ureadkey(3),usprintf(3),ustrzncpy(3)
and that's the whole page bestie!! π this lil masterpiece came from Allegro, version 4.4.3, and it's filed under exkeys(3). go press some keys, you got this. πβ¨π
π¦ 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