keypressed(3)

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

✨ NAME ✨

keypressed β€” tells you if there are keypresses waiting in the input buffer. This is the keypressed(3) page from the Allegro manual, aka the Allegro game programming library. πŸ’…


πŸ”₯ SYNOPSIS πŸ”₯

#include <allegro.h>

int keypressed();

πŸ’– DESCRIPTION πŸ’–

Okay so keypressed() returns TRUE if there are keypresses waiting in the input buffer. That's the whole vibe check. πŸ¦‹

You can use this to see if the next call to readkey() is going to block, or to simply wait for the user to press a key while you still update the screen β€” possibly drawing some animation. Iconic, no cap. ✨

Example:

          while (!keypressed()) {
             /* Show cool animated logo. */
          }
          /* So he skipped our title screen. */

πŸ‘‘ SEE ALSO πŸ‘‘


Allegro manual, version 4.4.3, keypressed(3) β€” that's the footer tea, bestie. No date listed, just the source and version, and that's periodt. πŸ’–πŸŽ€

πŸ“¦ where this page comes from