def decorator(callback): if not type_check(threshold, (int, float)): return threshold_data = threshold if threshold_data < 0: threshold_data = 0 type_str = type if type_str == "microphone": event_manager.event_register( event_o.EVENT_MICROPHONE, event_o.TRIGGER_ONCE_BY_VALUE_LARGER, callback, threshold_data) elif type_str == "timer": event_manager.event_register( event_o.EVE_TIME_OVER, event_o.TRIGGER_ONCE_BY_VALUE_LARGER, callback, threshold_data)
def button_pressed(callback): event_manager.event_register(event_o.EVENT_BUTTON, event_o.TRIGGER_ONCE_BY_VALUE_TRUE, callback, None)
def start(callback): event_manager.event_register(event_o.EVE_SYSTEM_LAUNCH, event_o.TRIGGER_ALWAYS_WITH_NO_PARAMETER, callback, None)
def arrow_up(callback): event_manager.event_register(event_o.EVENT_TILT_BACKWARD, event_o.TRIGGER_ONCE_BY_VALUE_TRUE, callback, None)
def tilted_right(callback): event_manager.event_register(event_o.EVENT_TILT_RIGHT, event_o.TRIGGER_ONCE_BY_VALUE_TRUE, callback, None)
def shaked(callback): event_manager.event_register(event_o.EVENT_SHAKED, event_o.TRIGGER_ONCE_BY_VALUE_TRUE, callback, None)
def decorator(callback): if type_check(mstr, str): mstr_str = str(mstr) event_manager.event_register(event_o.EVE_MESH_MESSAGE, event_o.TRIGGER_BY_STRING_MATCHING, callback, mstr_str)
def touchpad3_active(callback): event_manager.event_register(event_o.EVENT_TOUCHPAD_3, event_o.TRIGGER_ONCE_BY_VALUE_TRUE, callback, None)