clear_keybuf(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ clear_keybuf ✨

okay so bestie, welcome to the Allegro manual β€” yes THAT Allegro, the game programming library, the icon, the moment πŸ’…

🌸 NAME 🌸

clear_keybuf β€” clears the keyboard buffer. Allegro game programming library.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

void clear_keybuf();

πŸ’– DESCRIPTION πŸ’–

Okay so picture this: the keyboard buffer is just sitting there, lowkey hoarding every keypress you fed it. clear_keybuf() empties it. That's it. That's the whole job. No cap. πŸ’€

The way that you usually want this is at the start of your program, right before you start reading keys β€” because otherwise all those previously buffered keys are just gonna come crawling back out of readkey() or ureadkey() and you'll be like "why is my character walking left, I never pressed anything 😭". It's giving haunted keyboard. Clear the buffer, cleanse the vibe, periodt. ✨


πŸŽ€ SEE ALSO πŸŽ€


that's the whole page bestie, go forth and clear those buffers 🫢

🌈 sign-off time: this was Allegro, version 4.4.3 β€” clear_keybuf(3), mwah, iconic, no notes πŸ‘‘
πŸ“¦ where this page comes from