日期:2014-05-16 浏览次数:20696 次
for(;;) {
nready = poll(thepollfd, maxi + 1, INFTIME);
for(i = 0; i < OPEN_MAX; i++) {
if(thepollfd[i].fd < 0)
continue;
if(thepollfd[i].revents & POLLRDNORM) {
bzero(&event, sizeof(struct input_event));
if((n = read(thepollfd[i].fd, &event, sizeof(struct input_event))) >0) {
if(event.type = EV_KEY)
printf("get event type %u code %u value %d\n", event.type, event.code, event.value);
}
}
}
}
}