日期:2014-05-16 浏览次数:21032 次
if(FD_ISSET(inputfd, &rset)) {
// printf("inputfd is ok\n");
if(read(inputfd, &event, sizeof(struct input_event)) == 0) {
perror("read event error\n");
break;
}
// printf("read ok\n");
if (event.type == EV_KEY) {
printf("get event type %u code %u value %d\n", event.type, event.code, event.value);
}
}
printf("loop end\n");
}
}