code: def create_event_object(self,
                              event_type,
                              code,
                              value,
                              timeval=None):
          
          if not timeval:
              self.update_timeval()
              timeval = self.timeval
          try:
              event_code = self.type_codes[event_type]
          except KeyError:
              raise UnknownEventType(
                  "We don't know what kind of event a %s is." % event_type)
  
          event = struct.pack(EVENT_FORMAT,
                              timeval[0],
                              timeval[1],
                              event_code,
                              code,
                              value)
          return event
docs: Create an evdev style structure.