aa_getevent(3)

aa_getevent(3) πŸ’–

okay bestie, so this one is from the Library Functions Manual and it's literally all about keyboard events in AA-lib πŸŽ€ if you're out here trying to catch keypresses in your lil text-mode app, this is the one you're calling, no cap.


✨ NAME ✨

aa_getevent β€” keyboard functions πŸ’…

(yeah that's it, that's the whole name section, she's brief and she's iconic)


✨ SYNOPSIS ✨

#include <aalib.h>

int aa_getevent
(
     aa_context *c,
     int wait
);

🌸 PARAMETERS 🌸

  • aa_context *c β€” the AA-lib context you want this function to do its thing on 🫢
  • int wait β€” set this to 1 if you want it to wait for the event even when the queue is empty. otherwise it just peeks and bounces πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

she returns the next event from the queue πŸ“₯ and by that I mean the next event from the queue β€” optionally she'll wait for an event when the queue is empty if you told her to.

that's the whole vibe. queue in, event out, and patience is opt-in πŸ’…


⭐ RETURNS ⭐

here's the tea bestie, the return value is doing double duty:

  • values lower than 256 are used to report the ASCII values of pressed keys ⌨️
  • higher values have special meanings πŸ‘€
fr fr, if you want the actual full breakdown of those special meanings, go read the AA-lib texinfo documentation β€” that's where the details live, I'm not gonna make stuff up on you πŸ’€

and if the queue is empty and wait is set to 0, she returns 0. that's your "nobody's home, come back later" signal πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, gathered in one place, they're all linked and they all slay πŸ’–


this page was brought to you by c2man reading aalib.h, dated 8 September 1999 β€” yes she's an elder but she ate and she's still serving 🌈 mwah, go catch some keypresses bestie πŸ’…βœ¨