Exemple #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])
Exemple #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')
Exemple #3
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Exemple #4
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Exemple #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 ())
Exemple #6
0
 def __init__(self, **kwds):
     kwds['type'] = 'typed_event'
     Event.__init__(self, **kwds)
Exemple #7
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Exemple #8
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Exemple #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 () )
Exemple #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])
Exemple #11
0
 def __init__(self, changes):
     Event.__init__(self, type='config_change')
     self.changes = changes