ripple edge drag_handle tweaks, sync_parameter fix, shuttlerc, shortcuts
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / shdmp.C
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include <error.h>
6 #include <signal.h>
7 #include <linux/input.h>
8
9 input_event ev;
10
11 int main(int ac, char **av)
12 {
13         setbuf(stdout, 0);
14         if( ac < 2 ) { printf("usage: %s /dev/input/by-id/<device?>\n", av[0]); exit(1); }
15         int fd = open(av[1], O_RDONLY);
16         if( !fd ) { perror(av[1]); exit(1); }
17
18         for(;;) {
19                 int ret = read(fd, &ev, sizeof(ev));
20                 if( ret != sizeof(ev) ) {
21                         if( ret < 0 ) perror("read event");
22                         printf("bad read: %d\n", ret);
23                         break;
24                 }
25                 printf("event: (%d, %d, 0x%x)\n", ev.type, ev.code, ev.value);
26         }
27
28         return 0;
29 }
30