I have not done this since long ago in NeXTStep and seem to remember that you could create objects which could be made part of the event loop and could generate events that were co-equal with those from mouse and keyboard events. But... that was 20 years ago and I may have confounded it with something else.
In my particular case, I need a listener that checks a select() to see if one of many UDP ports have received a DGRAM. I need this to happen without disturbing the mouse and keyboard events, although it would be nice if I gave the UDP check a higher priority.
Basically, I have streams of numbers from one or more other systems that are to be displayed in a GUI, and I want the user to still be able to use buttons and such.