5 #include <sys/select.h>
14 int keyb_fd = get_keyboard_fd();
15 int mouse_fd = get_mouse_fd();
18 wm->process_windows();
23 FD_SET(keyb_fd, &read_set);
24 FD_SET(mouse_fd, &read_set);
26 int maxfd = keyb_fd > mouse_fd ? keyb_fd : mouse_fd;
28 while(select(maxfd + 1, &read_set, 0, 0, 0) == -1 && errno == EINTR);
30 if(FD_ISSET(keyb_fd, &read_set)) {
31 process_keyboard_event();
33 if(FD_ISSET(mouse_fd, &read_set)) {
34 process_mouse_event();