TICKIT_PEN_BIND_EVENT(3)

πŸ’– TICKIT_PEN_BIND_EVENT πŸ’–

okay so bestie, welcome to the TICKIT_PEN_BIND_EVENT(3) page from the Library Functions Manual ✨ this is the one about tickit_pen_bind_event and tickit_pen_unbind_event_id β€” aka adding and removing event handlers on a pen. no cap, it's giving very much "let me know when something happens to my pen" energy πŸ–ŠοΈπŸ’…


🌸 NAME 🌸

tickit_pen_bind_event, tickit_pen_unbind_event_id β€” add or remove event handlers πŸŽ€


✨ SYNOPSIS ✨

#include <tickit.h>

typedef int TickitPenEventFn(TickitPen *tt, TickitEventFlags flags,
    void *info, void *user);

int tickit_pen_bind_event(TickitPen *tt, TickitPenEvent ev,
    TickitBindFlags flags,
    TickitPenEventFn *fn, void *user);
void tickit_pen_unbind_event_id(TickitPen *tt, int id);

Link with -ltickit.


πŸ¦‹ DESCRIPTION πŸ¦‹

tickit_pen_bind_event() is literally the "hey bestie, watch this for me" function πŸ’– it adds a brand new event handler to the list of handlers that the pen is holding onto, and it hands you back an integer so you can identify that handler later. that handler is gonna get invoked every time the event given by the ev argument happens. and when it does get invoked, func gets passed:

  • the pen instance πŸ–ŠοΈ
  • a flags bitmask βš™οΈ
  • a pointer to an event information structure (whose type depends on the event β€” so like, it depends ok??) πŸ“¦
  • the user data pointer it was installed with πŸ‘›

tickit_pen_unbind_event_id() is the opposite vibe β€” it removes an event handler you added earlier, using the identifier that got returned when it was added. and if that handler was installed with TICKIT_BIND_UNBIND, then it gets invoked with the TICKIT_EV_UNBIND flag on its way out πŸ‘‹ it's not ghosting, it's saying a proper goodbye.


⭐ RETURN VALUE ⭐

  • tickit_pen_bind_event() returns an identifier integer πŸ”’
  • tickit_pen_unbind_event_id() returns no value β€” it's a void girlie, she gives nothing back πŸ™ˆ

🫢 SEE ALSO 🫢


and that's the whole page, bestie πŸ’œ this was the TICKIT_PEN_BIND_EVENT(3) page, straight outta the Library Functions Manual, and that footer line at the bottom? yeah that's just her name again β€” TICKIT_PEN_BIND_EVENT(3) β€” same energy, different corner of the page 😭✨ stay iconic, go bind some events, and remember: unbind responsibly πŸŽ€πŸ¦‹πŸ‘‘