|
|
|
@ -83,6 +83,9 @@ int main (void) |
|
|
|
|
if (epoll_wait(ev_fd, &ev_type, fd_num, -1) < 0 || dead) |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
if (ev_type.events != EPOLLIN) |
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
char buf[EVENT_BUF_LEN]; |
|
|
|
|
if (read(event_watcher, buf, EVENT_BUF_LEN) >= 0) { |
|
|
|
|
sleep(1); // wait for devices to settle
|
|
|
|
@ -95,7 +98,6 @@ int main (void) |
|
|
|
|
|
|
|
|
|
static unsigned int prev_size; |
|
|
|
|
prev_size = pb.size; |
|
|
|
|
if (ev_type.events == EPOLLIN) { |
|
|
|
|
for (int i = 0; i < fd_num; i++) { |
|
|
|
|
|
|
|
|
|
rb = read(fds[i], &event, sizeof(struct input_event)); |
|
|
|
@ -122,7 +124,6 @@ int main (void) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (pb.size != prev_size) { |
|
|
|
|
printf("Pressed keys: "); |
|
|
|
|