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));
34 void set_mouse_bounds(const Rect &rect)
44 void process_mouse_event()
47 * - read all pending events from mouse fd (use O_NONBLOCK so that
48 * read will return -1 when there are no more events instead of blocking).
49 * - process each event and update the pointer and button state
50 * - send each pointer move and button press/release to the tompost window
51 * with the pointer on it.
55 void get_pointer_pos(int *x, int *y)
61 int get_button_state(int bn)