install_keyboard_hooks(3)
β¨ NAME β¨
install_keyboard_hooks β bestie, this is the one that installs custom keyboard hooks. It lives in the Allegro game programming library π
πΈ SYNOPSIS πΈ
#include <allegro.h>
void install_keyboard_hooks(int (*keypressed)(), int (*readkey)());
π DESCRIPTION π
okay so listen. You should only use this function if you aren't using the rest of the keyboard handler. Like, that's the vibe check, and if you fail it this is not your girl. π
You call it in the place of install_keyboard(), and it lets you hand over your own callback routines for detecting and reading keypresses. Those callbacks are the ones that the main keypressed() and readkey() functions will end up using. So your custom logic is feeding the standard functions. iconic behaviour honestly π
And why would you even want that? Because it's useful if you want to use Allegro's GUI code with a custom keyboard handler β it gives the GUI a way to get keyboard input from your own code, completely bypassing the normal Allegro input system. no cap. π¦
fr fr: this is a swap out the whole input pipeline situation, not a little tweak. Make sure that's actually what you want before you commit to it. π
π SEE ALSO π
that's the whole page bestie, go forth and hook those keys π
Allegro manual, version 4.4.3 β install_keyboard_hooks(3) β mwah, that's a wrap π«Άβ¨
π¦ 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