90 if not self.thisptr.wait_event(self.event, timeout or 0): |
91 if not self.thisptr.wait_event(self.event, timeout or 0): |
91 # timeout |
92 # timeout |
92 return None |
93 return None |
93 event = self.event |
94 event = self.event |
94 if event.type == event.MOUSEMOVE: |
95 if event.type == event.MOUSEMOVE: |
95 return ('mousemove', event.mouse.x, event.mouse.y) |
96 return ('mousemove', 0, event.mouse.x, event.mouse.y, event.mouse.relx, event.mouse.rely) |
96 if event.type == event.MOUSEDOWN: |
97 if event.type == event.MOUSEDOWN: |
97 return ('mousedown', event.mouse.x, event.mouse.y, event.mouse.button) |
98 return ('mousedown', event.mouse.button, event.mouse.x, event.mouse.y) |
98 if event.type == event.MOUSEUP: |
99 if event.type == event.MOUSEUP: |
99 return ('mouseup', event.mouse.x, event.mouse.y, event.mouse.button) |
100 return ('mouseup', event.mouse.button, event.mouse.x, event.mouse.y) |
100 if event.type == event.MOUSEWHEEL: |
101 if event.type == event.MOUSEWHEEL: |
101 return ('mousewheel', event.mouse.x, event.mouse.y, event.mouse.button) |
102 return ('mousewheel', event.mouse.button, event.mouse.x, event.mouse.y) |
102 if event.type == event.KEYPRESS: |
103 if event.type == event.KEYPRESS: |
103 keyname = event.key.keyname |
104 keyname = event.key.keyname |
104 if keyname: |
105 if keyname: |
105 keyname = keyname.decode() |
106 keyname = keyname.decode() |
106 else: |
107 else: |