register_event_alias#

carb.events.register_event_alias(
event_type: int,
push_event: str,
pop_event: str,
) bool#

Registers an alias between `event_type` and event names.

This is generally recommended for use with AdapterType.FULL_ALIAS. This allows event adapters created of type AdapterType.FULL_ALIAS to map `event_type` with the corresponding `IEventDispatcher` event names for pushing (`push_event`) and popping (`pop_event`).

Corresponding with `IEventsAdapter` created from AdapterType.FULL_ALIAS, the following event names will be aliased: * f”AdapterAlias:{event_type}:immediate” becomes an alias to `push_event`. * f”AdapterAlias:{event_type}” becomes an alias to `pop_event`.

When the aliases are no longer needed, unregister_event_alias() can be used to remove them.

Parameters:
  • event_type – (int) The EventType to use with aliasing. May not be 0.

  • push_event – (str) The IEventDispatcher event name to use for push (immediate) events.

  • pop_event – (str) The IEventDispatcher event name to use for pop (deferred) events.

Returns:

True if the aliases were created; False if either alias could not be created or event_type was 0.