0

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.

Dale Amon
  • 219
  • 2
  • 5

1 Answers1

0

According to the cocoa events guide you can raise an event with type NSApplicationDefined.

     [NSEvent otherEventWithType:NSApplicationDefined location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:]

As for how to raise them, I'm not exactly sure what you need, but this post on the apple developer lists shows how to register a UDP listener. It raises a notification via NSNotificationCenter, but you could make that an event.