def __init__(self, type, pos=None, button=None, modifiers=None, delta=None, **kwds): Event.__init__(self, type, **kwds) self._pos = (0, 0) if (pos is None) else (pos[0], pos[1]) self._button = int(button) if (button is not None) else 0 self._modifiers = tuple(modifiers or ()) self._delta = (0.0, 0.0) if (delta is None) else (delta[0], delta[1])
def test_prebuilt_event(self): """Emit pre-built event""" em = EventEmitter(type='test_event') em.default_args['key1'] = 'test1' em.connect(self.record_event) self.result = None ev = Event(type='my_type') em(ev) self.assert_result(event=ev, type='my_type') assert not hasattr(self.result[0], 'key1')
def __init__(self, type, region=None, **kwds): Event.__init__(self, type, **kwds) self._region = region
def __init__(self, type, size=None, **kwds): Event.__init__(self, type, **kwds) self._size = tuple(size)
def __init__(self, type, key=None, text='', modifiers=None, **kwds): Event.__init__(self, type, **kwds) self._key = key self._text = text self._modifiers = tuple(modifiers or ())
def __init__(self, **kwds): kwds['type'] = 'typed_event' Event.__init__(self, **kwds)
def __init__(self, type, key=None, text='', modifiers=None, **kwds): Event.__init__(self, type, **kwds) self._key = key self._text = text self._modifiers = tuple( modifiers or () )
def __init__(self, type, pos=None, button=None, modifiers=None, delta=None, **kwds): Event.__init__(self, type, **kwds) self._pos = (0,0) if (pos is None) else (pos[0], pos[1]) self._button = int(button) if (button is not None) else 0 self._modifiers = tuple( modifiers or () ) self._delta = (0.0,0.0) if (delta is None) else (delta[0], delta[1])
def __init__(self, changes): Event.__init__(self, type='config_change') self.changes = changes