int optch;
int i;
event_t events[EVENTS];
- int verbose = 0;
+ int verbose = 1;
- while((optch = getopt(argc, argv, "hv")) != -1) {
+ while((optch = getopt(argc, argv, "hn")) != -1) {
switch(optch) {
case('h'):
- printf("Usage: %s [-v|-h]\n", argv[0]);
+ printf("Usage: %s [-n|-h]\n", argv[0]);
+ printf("-n nonverbose\n");
+ printf("-h help\n");
return 0;
break;
- case('v'):
- verbose = 1;
+ case('n'):
+ verbose = 0;
break;
}
}
// List input devices
for(i = 0; i < EVENTS; i++) {
- char device[18];
+ char device[19];
sprintf(device, "/dev/input/event%i", i);
events[i].fd = open(device, O_RDONLY);
continue;
}
- if(event.type == EV_REL) {
+ if(event.type == EV_REL || event.type == EV_ABS) {
double time;
int hz;