14 static int dev_fd = -1; // file descriptor for /dev/psaux
16 static int pointer_x, pointer_y;
20 if((dev_fd = open("/dev/psaux", O_NONBLOCK)) == -1) {
21 fprintf(stderr, "Cannot open /dev/psaux : %s\n", strerror(errno));
33 void set_mouse_bounds(const Rect &rect)
43 void process_mouse_event()
46 * - read all pending events from mouse fd (use O_NONBLOCK so that
47 * read will return -1 when there are no more events instead of blocking).
48 * - process each event and update the pointer and button state
49 * - send each pointer move and button press/release to the tompost window
50 * with the pointer on it.
54 void get_pointer_pos(int *x, int *y)
60 int get_button_state(int bn)