def event_callback(key):
    """
    Decorator for defining a event callback method. Adds a property attribute "event_key" with value as the passed key.

    :param key:
    :return:
    """
    def decorator(func):
        func.event_key = key
        return func
    return decorator