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