diff --git a/functions/joyutils.c b/functions/joyutils.c index a1b1083..350f832 100644 --- a/functions/joyutils.c +++ b/functions/joyutils.c @@ -28,6 +28,7 @@ else { } return "???"; } +/* ----------------------------------------------------------------- */ void dump_my_joystick(char *joy_device) { int joy_fd, foo; @@ -47,23 +48,19 @@ fprintf(stderr, "Name: \"%s\"\n", joy_name); for (;;) { foo = read(joy_fd, &js, sizeof(struct js_event)); - if ( ! flag ) { - debut = js.time; - flag = 1; - } - if (8 != foo) { fprintf(stderr, "%s: err reading joy\n", __func__); exit(1); } - - printf("%8lu %4d / %-8s %2d %7d\n", + if ( ! flag ) { + debut = js.time; + flag = 1; + } + printf("%8lu %4d %-8s %3d %7d\n", js.time-debut, js.type, type2txt(js.type), js.number, js.value); - } - } /* ----------------------------------------------------------------- */