Ejemplo n.º 1
0
 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])
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Ejemplo n.º 4
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Ejemplo n.º 5
0
 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 ())
Ejemplo n.º 6
0
 def __init__(self, **kwds):
     kwds['type'] = 'typed_event'
     Event.__init__(self, **kwds)
Ejemplo n.º 7
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Ejemplo n.º 8
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Ejemplo n.º 9
0
 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 () )
Ejemplo n.º 10
0
 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])
Ejemplo n.º 11
0
 def __init__(self, changes):
     Event.__init__(self, type='config_change')
     self.changes = changes