target_updatehandler(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… target_updatehandler πŸ’…

okay bestie, welcome to the Arcan Lua API page for target_updatehandler. It’s giving β€œchange the active callback for a VID connected to a frameserver,” and honestly? iconic. ✨


πŸŽ€ NAME πŸŽ€

  • target_updatehandler β€” change the active callback for a VID connected to a frameserver. slay. πŸ’–

✨ SYNOPSIS ✨

nil
target_updatehandler( vid, callback_function )

πŸ¦‹ DESCRIPTION πŸ¦‹

Every frameserver can have one active Lua function as a callback. That callback receives events related to the frameserver it’s attached to. 🫢

Sometimes you’ll want to update or replace the function associated with a specific frameserver-connected VID β€” for example when you’re adopting one as part of a system collapse or fallback script. Very main character energy. πŸ’…


🌸 NOTES 🌸

  1. If WORLDID is a frameserver (as in valid_vid( WORLDID , TYPE_FRAMESERVER )), this function can be used to attach a handler to that as well. This can be the case when there’s an outer windowing system to integrate with. πŸͺŸβœ¨
  2. If callback_function is set to nil, frameserver related events will be silently dropped β€” except for special cases that are handled internally (see event_queuetransfer in engine/arcan_event.c). Silently dropped, bestie. πŸ‘€πŸ’€

🌟 EXAMPLE 🌟

First example is giving β€œswap the handler from inside the handler.” πŸŒ€

       function target_updatehandler0()
             a = launch_avfeed("", "avfeed", function(source, status)
                   print("in first handler");
                   target_updatehandler(source, function()
                         print("in second handler");
                   end);
             end);
       end

🌟 EXAMPLE 🌟

Second one does a little vibe check on WORLDID first, then attaches a wm event printer. πŸ–¨οΈπŸ’œ

       function target_updatehandler1()
             if valid_vid(WORLDID, TYPE_FRAMESERVER) then
                   target_updatehandler(WORLDID, function(source, status)
                         print("wm event", status.kind)
                   end)
             end
       end

πŸ’€ MISUSE πŸ’€

πŸ’€ this is the MISUSE example for a reason, bestie β€” do not copy this one. πŸ™ˆ
       function target_updatehandler0()
             a = launch_avfeed("", "avfeed", function() end);
             target_updatehandler(a, target_updatehandler);
       end

πŸ”— SEE ALSO πŸ”—

  • targetcontrol β€” go check it out, it’s right there in the reference list. πŸŽ€

okay that’s the whole page, bestie β€” brought to you by targetcontrol, dated October 2026, and filed under target_updatehandler(3). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from