printf("%s %s", string->prefix, string->main);
}
+static void pr_time(struct timeval tv) {
+ printf("%ju.%06d", (uintmax_t)tv.tv_sec, (int)tv.tv_usec);
+}
+
static void dump_event(Device *d, const struct input_event *ie) {
const InputEventTypeInfo *t;
printf("event ");
+ pr_time(ie->time);
+
+ printf(" ");
PR_TABLE_STR(ev, ie->type);
printf(" ");
int r, remain;
char *p;
- printf("event-group-start device %s\n",d->path);
+ printf("report-from device %s\n",d->path);
for (;;) {
for (p=(void*)&ie, remain=sizeof(ie);
assert(r <= remain);
}
if (ie.type == EV_SYN) {
- printf("synchronised %ju.%06d\n",
- (uintmax_t)ie.time.tv_sec,
- (int)ie.time.tv_usec);
+ printf("synch ");
+ pr_time(ie.time);
+ printf("\n");
break;
}
r= ioctl(d->fd, EVIOCGID, &iid); if (r) diee("%s: failed to get id",path);
printf("device %s bustype ", path);
PR_TABLE_STR(bus, iid.bustype);
- printf(" vendor %#x product #%x version %#x\n",
+ printf(" vendor %#x product %#x version %#x\n",
iid.vendor, iid.product, iid.version);
mflushstdout();
int main(int argc, const char **argv) {
const char *arg;
+ mode= &mode_dump;
+
while ((arg= *++argv)) {
if (arg[0] != '-') {
getdevice(arg);