Event#

class carb.eventdispatcher.Event#

Bases: pybind11_object

Event.

Contains the event_name and payload for a dispatched event.

Methods

__init__(*args, **kwargs)

get(self, key_name)

Accesses a payload item by key name.

has_key(self, key_name)

Returns True if a given key name is present in the payload.

Attributes

event_name

The name of the event

payload

Returns the event parameters as a dict.

__init__(*args, **kwargs)#
get(
self: carb.eventdispatcher._eventdispatcher.Event,
key_name: str,
) object#

Accesses a payload item by key name.

Parameters:

key_name – The name of a key to find in the payload.

Returns:

None if the key is not present, otherwise returns an object representative of the type in the payload.

has_key(
self: carb.eventdispatcher._eventdispatcher.Event,
key_name: str,
) bool#

Returns True if a given key name is present in the payload.

Parameters:

key_name – The name of a key to check against the payload.

Returns:

`True` if the key is present in the payload; `False` otherwise.

property event_name#

The name of the event

property payload#

Returns the event parameters as a dict.

NOTE: The return value is built on demand, so the first call to this property is more expensive. Instead, consider using `self` directly since it supports __getitem__ and __contains__.

Returns:

A dict of the event arguments.