-
-
Notifications
You must be signed in to change notification settings - Fork 216
Description
Description
Basically, the goal is to add event watchers as a new potential way of handling events, to complement the standard event loop without breaking compatibility.
Currently, the syntax is like this:
@pygame.event.add_event_watcher
def eventWatcher(event):
... # use the event somehowWhenever events are added to the queue, they are sent to the event watchers, they can still be accessed from an event loop as usual, however.
@ankith26 and @aatle proposed making them behave more like SDL_appEvent, however, IMO that is somewhat more intrusive to the standard event loop. I am curious what other people think about it.
Currently, any exceptions thrown by the watcher are logged and otherwise ignored, this is probably not great. Again, I am interested in other people's input on the matter
I already have opened a PR for this, #3637; there are some other details and an example usage of the feature there as well.