This commit is contained in:
tTh 2024-03-31 21:25:19 +02:00
parent 7879c84020
commit 593eeeddc9
1 changed files with 6 additions and 9 deletions

View File

@ -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);
}
}
/* ----------------------------------------------------------------- */