You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The InputEventListener.register function should have a flag to optionally send events to callback functions.
import pifacedigitalio
def somefunction():
"""This function has no event argument."""
pass
listener = pifacedigitalio.InputEventListener()
l.register(0, p.IODIR_DIR, somefunction, send_event=False)
l.activate()
somefunction is not passed an event object because send_event was set to False in the register function. send_event will default to True.
I'm not sure whether this should be implemented or not because it allows programmers to be inconsistent in callback definitions and you can just ignore the event anyway.
It is useful for directly calling existing library functions, that don't accept event objects. For example:
The
InputEventListener.register
function should have a flag to optionally send events to callback functions.somefunction
is not passed an event object becausesend_event
was set to False in the register function.send_event
will default to True.I'm not sure whether this should be implemented or not because it allows programmers to be inconsistent in callback definitions and you can just ignore the event anyway.
It is useful for directly calling existing library functions, that don't accept event objects. For example:
robot.walk()
is not expecting any event objects so we do not send it any. Currently this can be wrapped up with:The text was updated successfully, but these errors were encountered: