Make a new event and send it to the character device.
978413
def _make_event(self, event_type, code, value):
        """"""
        secs, msecs = convert_timeval(time.time())
        data = struct.pack(EVENT_FORMAT,
                           secs,
                           msecs,
                           event_type,
                           code,
                           value)
        self._write_device.write(data)
        self._write_device.flush()
257259
def handle_new_events(self, events):
        """"""
        for event in events:
            self.events.append(
                self.create_event_object(
                    event[0],
                    event[1],
                    int(event[2])))
631039
function createEvent (type, data) {
  let event = document.createEvent(specialEvents[type] || 'Event')
  event.initEvent(type, true, true)
  data && (event.data = data)
  return event
}
914287
def mousePressEvent( self, event ):
        
        XPopupWidget.hideToolTip()
        
        # update the current date
        self.setCurrentDate(self.dateAt(event.scenePos()))
        
        super(XCalendarScene, self).mousePressEvent(event)
85206
def push_event(self, evt):
        """"""
        try:
            self._push_event(evt)
        except Exception as e:
            print("Unexpected error in callback for %s: %s"
                  % (str(evt), str(e)), file=self._fd)
249380
def send(self, event):
        """"""
        event_str = json.dumps(event, cls=DateTimeJSONEncoder)

        # TODO: do something smarter than simply dropping the event on
        # the floor.
        if self.max_event_size is None or len(event_str) <= self.max_event_size:
            self.log(event_str)
873558
def new_event(self, subject=None):
        
        return self.event_constructor(parent=self, subject=subject,
                                      calendar_id=self.calendar_id)
287444
def send(self, message_id, args=[], kwargs={}):
        
        self._logger.debug('Send {} in stm {}'.format(message_id, self.id))
        self._driver._add_event(
            event_id=message_id, args=args, kwargs=kwargs, stm=self)
619857
def push_event(self, event_name, event_type, block_id):
        """"""
        self._db.rpush(event_name, dict(type=event_type, id=block_id))
1248292
def addEvent(self, event, fd, action):
        
        self._events[event] = (fd, action)
212146
def new_character(self, name, data=None, **kwargs):
        """"""
        self.add_character(name, data, **kwargs)
        return self.character[name]
441623
async def send_event(self, client_id, service_name, event_name, event_info, directed_client=None):
        """"""

        if directed_client is not None and directed_client != client_id:
            return

        client_info = self.clients.get(client_id)
        if client_info is None:
            self._logger.warning("Attempted to send event to invalid client id: %s", client_id)
            return

        conn = client_info['connection']

        event = dict(service=service_name)
        if event_info is not None:
            event['payload'] = event_info

        self._logger.debug("Sending event: %s", event)

        await self.server.send_event(conn, event_name, event)
905345
def processVREvent(self, event):
        ""
        et = event.eventType
        if et == openvr.VREvent_TrackedDeviceActivated:
            self.setupRenderModelForTrackedDevice( event.trackedDeviceIndex )
            dprintf( "Device %u attached. Setting up render model.\n" % event.trackedDeviceIndex )
        elif et == openvr.VREvent_TrackedDeviceDeactivated:
            dprintf( "Device %u detached.\n" % event.trackedDeviceIndex )
        elif et == openvr.VREvent_TrackedDeviceUpdated:
            dprintf( "Device %u updated.\n" % event.trackedDeviceIndex )
1053427
def add_event(self, key, event):
        """"""
        if key in self.keys or key in self.events:
            raise EventStore.EventKeyAlreadyExistError(
                "The key already existed: {0}".format(key))
        self.keys.append(key)
        # Important no exceptions happen between these lines!
        self.events[key] = event
1266989
def publish_event(self, channel, event, message):
        '''
        '''
        assert self.protocol is not None, "Protocol required"
        msg = {'event': event, 'channel': channel}
        if message:
            msg['data'] = message
        return self.publish(channel, msg)
218182
def handle_event(self, packet):
        """"""
        if packet.get('command'):
            task = self.send_command_ack(packet['id'], packet['command'])
            self.loop.create_task(task)
150214
def _create_event():
    
    return windll.kernel32.CreateEventA(pointer(SECURITY_ATTRIBUTES()), BOOL(True), BOOL(False), None)