• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:event

54     for event in packet:
57 pretty_event.append('time %.6f,' % event[MTB.EV_TIME])
58 if event.get(MTB.SYN_REPORT):
61 ev_type = event[MTB.EV_TYPE]
63 ev_code = event[MTB.EV_CODE]
66 pretty_event.append('value %d' % event[MTB.EV_VALUE])
77 for event in packet:
78 if event.get(MTB.SYN_REPORT):
79 evemu_event = evemu_format_syn_report % event[MTB.EV_TIME]
81 evemu_event = evemu_format % (event[MTB.EV_TIME],
82 event[MTB.EV_TYPE],
83 event[MTB.EV_CODE],
84 event[MTB.EV_VALUE])
133 def try_to_add(packet, event): argument
135 _, _, _, value = event
137 packet.append(MtbParser.make_ev_dict(event))
143 for event in packet:
144 sm.add_event(event)
184 def is_ABS_MT_TRACKING_ID(cls, event): argument
186 return (not event.get(MTB.SYN_REPORT) and
187 event[MTB.EV_TYPE] == EV_ABS and
188 event[MTB.EV_CODE] == ABS_MT_TRACKING_ID)
191 def is_new_contact(cls, event): argument
193 return cls.is_ABS_MT_TRACKING_ID(event) and event[MTB.EV_VALUE] != -1
196 def is_finger_leaving(cls, event): argument
198 return cls.is_ABS_MT_TRACKING_ID(event) and event[MTB.EV_VALUE] == -1
201 def is_ABS_MT_SLOT(cls, event): argument
203 return (not event.get(MTB.SYN_REPORT) and
204 event[MTB.EV_TYPE] == EV_ABS and
205 event[MTB.EV_CODE] == ABS_MT_SLOT)
208 def is_ABS_MT_POSITION_X(cls, event): argument
210 return (not event.get(MTB.SYN_REPORT) and
211 event[MTB.EV_TYPE] == EV_ABS and
212 event[MTB.EV_CODE] == ABS_MT_POSITION_X)
215 def is_ABS_MT_POSITION_Y(cls, event): argument
217 return (not event.get(MTB.SYN_REPORT) and
218 event[MTB.EV_TYPE] == EV_ABS and
219 event[MTB.EV_CODE] == ABS_MT_POSITION_Y)
222 def is_ABS_MT_PRESSURE(self, event): argument
224 return (not event.get(MTB.SYN_REPORT) and
225 event[MTB.EV_TYPE] == EV_ABS and
226 event[MTB.EV_CODE] == ABS_MT_PRESSURE)
229 def is_finger_data(cls, event): argument
230 return (cls.is_ABS_MT_POSITION_X(event) or
231 cls.is_ABS_MT_POSITION_Y(event) or
232 cls.is_ABS_MT_PRESSURE(event))
235 def is_EV_KEY(cls, event): argument
237 return (not event.get(MTB.SYN_REPORT) and event[MTB.EV_TYPE] == EV_KEY)
240 def is_BTN_LEFT(cls, event): argument
242 return (cls.is_EV_KEY(event) and event[MTB.EV_CODE] == BTN_LEFT)
245 def is_BTN_LEFT_value(cls, event, value): argument
247 return (cls.is_BTN_LEFT(event) and event[MTB.EV_VALUE] == value)
250 def is_BTN_TOOL_FINGER(cls, event): argument
252 return (cls.is_EV_KEY(event) and
253 event[MTB.EV_CODE] == BTN_TOOL_FINGER)
256 def is_BTN_TOOL_DOUBLETAP(cls, event): argument
258 return (cls.is_EV_KEY(event) and
259 event[MTB.EV_CODE] == BTN_TOOL_DOUBLETAP)
262 def is_BTN_TOOL_TRIPLETAP(cls, event): argument
264 return (cls.is_EV_KEY(event) and
265 event[MTB.EV_CODE] == BTN_TOOL_TRIPLETAP)
268 def is_BTN_TOOL_QUADTAP(cls, event): argument
270 return (cls.is_EV_KEY(event) and
271 event[MTB.EV_CODE] == BTN_TOOL_QUADTAP)
274 def is_BTN_TOOL_QUINTTAP(cls, event): argument
276 return (cls.is_EV_KEY(event) and
277 event[MTB.EV_CODE] == BTN_TOOL_QUINTTAP)
280 def is_BTN_TOUCH(cls, event): argument
282 return (cls.is_EV_KEY(event) and
283 event[MTB.EV_CODE] == BTN_TOUCH)
286 def is_SYN_REPORT(self, event): argument
288 return event.get(MTB.SYN_REPORT, False)
297 def _convert_event(self, event): argument
298 (tv_sec, tv_usec, ev_type, ev_code, ev_value) = event
306 def process_event(self, event): argument
308 converted_event = self._convert_event(event)
358 for event in packet:
360 if MtbEvent.is_ABS_MT_SLOT(event):
361 curr_slot_id = event[MTB.EV_VALUE]
366 elif MtbEvent.is_new_contact(event):
367 slot_to_tid.update({curr_slot_id: event[MTB.EV_VALUE]})
372 elif MtbEvent.is_finger_leaving(event):
379 elif MtbEvent.is_finger_data(event):
384 elif MtbEvent.is_SYN_REPORT(event):
437 def add_event(self, event): argument
445 if MtbEvent.is_ABS_MT_SLOT(event):
446 self.slot = event[MTB.EV_VALUE]
449 elif MtbEvent.is_new_contact(event):
450 self._add_new_tracking_id(event[MTB.EV_VALUE])
454 elif MtbEvent.is_finger_leaving(event):
461 MtbEvent.is_finger_data(event)):
465 if MtbEvent.is_ABS_MT_POSITION_X(event):
466 self.point[self.slot_to_tid[self.slot]].x = event[MTB.EV_VALUE]
469 elif MtbEvent.is_ABS_MT_POSITION_Y(event):
470 self.point[self.slot_to_tid[self.slot]].y = event[MTB.EV_VALUE]
473 elif MtbEvent.is_ABS_MT_PRESSURE(event):
474 self.pressure[self.slot_to_tid[self.slot]] = event[MTB.EV_VALUE]
477 elif MtbEvent.is_SYN_REPORT(event):
478 self.syn_time = event[MTB.EV_TIME]
598 for event in packet:
599 if MtbEvent.is_new_contact(event):
623 for event in packet:
624 if MtbEvent.is_ABS_MT_SLOT(event):
625 slot = event[MTB.EV_VALUE]
632 if MtbEvent.is_ABS_MT_POSITION_X(event):
633 prev_x = event[MTB.EV_VALUE]
635 elif MtbEvent.is_ABS_MT_POSITION_Y(event):
636 prev_y = event[MTB.EV_VALUE]
638 elif MtbEvent.is_finger_leaving(event):
698 for event in packet:
699 sm.add_event(event)
779 for event in packet:
780 if MtbEvent.is_ABS_MT_SLOT(event):
781 slot = event[MTB.EV_VALUE]
785 if MtbEvent.is_ABS_MT_TRACKING_ID(event):
786 if MtbEvent.is_new_contact(event):
788 elif MtbEvent.is_finger_leaving(event):
790 elif MtbEvent.is_ABS_MT_POSITION_X(event):
791 x[slot] = event[MTB.EV_VALUE]
792 elif MtbEvent.is_ABS_MT_POSITION_Y(event):
793 y[slot] = event[MTB.EV_VALUE]
858 for event in packet:
859 if MtbEvent.is_ABS_MT_POSITION_X(event):
860 x = event[MTB.EV_VALUE]
863 elif MtbEvent.is_ABS_MT_POSITION_Y(event):
864 y = event[MTB.EV_VALUE]
875 for event in packet:
876 if MtbEvent.is_ABS_MT_SLOT(event):
877 slot = event[MTB.EV_VALUE]
878 elif (MtbEvent.is_ABS_MT_POSITION_X(event) and
880 x = event[MTB.EV_VALUE]
883 elif (MtbEvent.is_ABS_MT_POSITION_Y(event) and
885 y = event[MTB.EV_VALUE]
1235 def _call_check_event_func(self, event, expected_value, check_event_result, argument
1243 if func(event):
1244 event_value = event[MTB.EV_VALUE]
1281 for event in packet:
1284 self._call_check_event_func(event, expected_value,
1294 self._call_check_event_func(event, expected_value,
1340 for event in packet:
1342 if (MtbEvent.is_BTN_LEFT_value(event, 1) and
1346 elif (MtbEvent.is_BTN_LEFT_value(event, 0) and
1365 for event in packet:
1366 sm.add_event(event)
1367 if MtbEvent.is_BTN_LEFT_value(event, 1):
1369 elif MtbEvent.is_BTN_LEFT_value(event, 0):
1430 def make_ev_dict(event): argument
1431 (ev_time, ev_type, ev_code, ev_value) = event