3 #include <linux/input.h>
10 struct termios term2 = term;
11 term2.c_lflag &= ~ICANON;
12 tcsetattr(0, TCSANOW, &term2);
15 ioctl(0, FIONREAD, &byteswaiting);
17 tcsetattr(0, TCSANOW, &term);
19 return byteswaiting > 0;
24 int get_mouse_status(char *x, char *y, char *b) {
25 struct input_event ie;
26 if (read(mouse_fd, &ie, sizeof(struct input_event)) != -1) {
27 *b = ((char *)&ie)[0];
28 *x = ((char *)&ie)[1];
29 *y = ((char *)&ie)[2];