2 #include <sys/select.h>
11 void cleanup_input(void)
15 static int convkey(int key)
45 if(key >= KEY_F(1) && key <= KEY_F(12)) {
46 return KB_F1 + (key - KEY_F(1));
54 int poll_input(union event *ev)
57 if((ev->key.key = convkey(getch())) == -1) {
66 struct timeval tv = {0, 0};
71 while(select(1, &rdset, 0, 0, &tv) == -1 && errno == EINTR);
73 if(FD_ISSET(0, &rdset)) {