3 #include <sys/select.h>
11 int keyb_fd = get_keyboard_fd();
12 int mouse_fd = get_mouse_fd();
15 wm->process_windows();
20 FD_SET(keyb_fd, &read_set);
21 FD_SET(mouse_fd, &read_set);
23 int maxfd = keyb_fd > mouse_fd ? keyb_fd : mouse_fd;
25 while(select(maxfd + 1, &read_set, 0, 0, 0) == -1 && errno == EINTR);
27 if(FD_ISSET(keyb_fd, &read_set)) {
28 process_keyboard_event();
30 if(FD_ISSET(mouse_fd, &read_set)) {
31 process_mouse_event();