def METHOD_NAME(self):
    r"""Implements the interaction. This can be overridden to implement
    more complicated keyboard/ mouse interactions.
    """
    retval = None
    while True:
        d = yield retval
        if d[u'type'] == u'click':
            retval = self.on_mouse_click(d['pos'])
        elif d[u'type'] == u'key':
            retval = self.on_key_press(d[u'key'])
        elif d[u'type'] == u'stop':
            break