Exemplo n.º 1
0
 def __init__(self, type, pos=None, button=None, buttons=None, 
              modifiers=None, delta=None, last_event=None, press_event=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._buttons = [] if (buttons is None) else buttons
     self._modifiers = tuple( modifiers or () )
     self._delta = (0.0,0.0) if (delta is None) else (delta[0], delta[1])
     self._last_event = last_event
     self._press_event = press_event
Exemplo n.º 2
0
 def __init__(self,
              type,
              pos=None,
              button=None,
              buttons=None,
              modifiers=None,
              delta=None,
              last_event=None,
              press_event=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._buttons = [] if (buttons is None) else buttons
     self._modifiers = tuple(modifiers or ())
     self._delta = (0.0, 0.0) if (delta is None) else (delta[0], delta[1])
     self._last_event = last_event
     self._press_event = press_event
Exemplo n.º 3
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')
Exemplo n.º 4
0
 def __init__(self, **kwargs):
     kwargs['type'] = 'typed_event'
     Event.__init__(self, **kwargs)
Exemplo n.º 5
0
 def __init__(self, **kwds):
     kwds['type'] = 'typed_event'
     Event.__init__(self, **kwds)
Exemplo n.º 6
0
 def __init__(self, changes):
     Event.__init__(self, type='config_change')
     self.changes = changes
Exemplo n.º 7
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Exemplo n.º 8
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Exemplo 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 ())
Exemplo n.º 10
0
 def __init__(self, changes):
     Event.__init__(self, type='config_change')
     self.changes = changes
Exemplo n.º 11
0
 def __init__(self, **kwds):
     kwds["type"] = "typed_event"
     Event.__init__(self, **kwds)
Exemplo n.º 12
0
 def __init__(self, type, region=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._region = region
Exemplo n.º 13
0
 def __init__(self, type, size=None, **kwds):
     Event.__init__(self, type, **kwds)
     self._size = tuple(size)
Exemplo n.º 14
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 () )