def METHOD_NAME(self, file_id, key_code, value):
    if file_id not in self.events:
        raise ValueError("file_id {0} does not exist".format(file_id))
    if value in KEY_ACTION:
        value = KEY_ACTION[value]
    else:
        value = 0x00
    event_binary = struct.pack(EVENT_FORMAT, self._tick, 0, EV_KEY, key_code, value)
    pipe_fd = self.events[file_id][1]
    os.write(pipe_fd, event_binary)
    return len(event_binary)