TICKIT_TERM_BIND_EVENT(3)

✨ TICKIT_TERM_BIND_EVENT ✨

okay bestie, gather round, because this is the page for tickit_term_bind_event and tickit_term_unbind_event_id β€” the two functions that let you add or remove event handlers on a terminal. it's giving "let me know when something happens" energy and honestly? iconic. this one lives in the Library Functions Manual, so you know it's the real deal πŸ’…


🌸 SYNOPSIS 🌸

#include <tickit.h>

typedef int TickitTermEventFn(TickitTerm *tt, TickitEventFlags flags,
    void *info, void *user);

int tickit_term_bind_event(TickitTerm *tt, TickitTermEvent ev,
    TickitBindFlags flags,
    TickitTermEventFn *fn, void *user);
void tickit_term_unbind_event_id(TickitTerm *tt, int id);

and don't forget, babes β€” you gotta link with -ltickit. no cap, it will not build without it 🫢


πŸ’– DESCRIPTION πŸ’–

so tickit_term_bind_event() is the main character here. it adds a brand new event handler to the list of handlers that the terminal is keeping track of, and then it hands you back an integer that identifies that specific handler. think of it like a little name tag. πŸŽ€

this handler is gonna get invoked every time the event given by the ev argument happens. and when it does get invoked, func will be passed:

  • the terminal instance,
  • a flags bitmask,
  • a pointer to an event information structure (and the type of that struct depends on the event, so stay woke πŸ‘€),
  • and the user data pointer it was installed with.

then there's tickit_term_unbind_event_id() β€” the "okay bye" function. it removes an event handler that was previously added, using the identifier that got returned when it was added. and listen, this part matters: it will invoke that handler with the TICKIT_EV_UNBIND flag if it was installed with TICKIT_BIND_UNBIND. so it's not just a silent removal, bestie, it says goodbye properly ✨


πŸ¦‹ RETURN VALUE πŸ¦‹

  • tickit_term_bind_event() returns an identifier integer. that's your little handler name tag, keep it safe πŸ”₯
  • tickit_term_unbind_event_id() returns no value. it simply does the thing and leaves. no notes. πŸ’€

🌈 SEE ALSO 🌈


and that's the whole vibe, bestie πŸ’œ this was the TICKIT_TERM_BIND_EVENT(3) page from the Library Functions Manual β€” footer and all, exactly as it came, no details ghosted, periodt. go bind some events and slay πŸ‘‘βœ¨