xkbcommon
Alessandro Mauri 5 years ago
parent 129f0ce8e8
commit b18fb0cf8e
  1. 5
      hkd.c

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

Loading…
Cancel
Save