/* --------- hide the mouse cursor ------- */ void hide_mousecursor(void) { if (mouse_installed()) { segread(&sregs); mouse(2,0,0,0); } }
/* --------- display the mouse cursor -------- */ void show_mousecursor(void) { if (mouse_installed()) { segread(&sregs); mouse(1,0,0,0); } }
/* -------- position the mouse cursor -------- */ void set_mouseposition(int x, int y) { if (mouse_installed()) { if (SCREENWIDTH == 40) x *= 2; mouse(4,0,x*8,y*8); } }
/* --- return true if a mouse button has been released --- */ int button_releases(void) { if (mouse_installed()) { mouse(6,0,0,0); return regs.h.bx; } return 0; }
/* ------ return true if mouse buttons are pressed ------- */ int mousebuttons(void) { if (mouse_installed()) { mouse(3,0,0,0); return regs.h.bx & 3; } return 0; }
/* --- return true if a mouse button has been released --- */ int button_releases(void) { if (mouse_installed()) { segread(&sregs); mouse(6,0,0,0); return regs.x.bx; } return 0; }
/* ------ return true if mouse buttons are pressed ------- */ int mousebuttons(void) { if (mouse_installed()) { segread(&sregs); mouse(3,0,0,0); return regs.x.bx & 3; } return 0; }
/* ---------- return mouse coordinates ---------- */ void get_mouseposition(int *x, int *y) { *x = *y = -1; if (mouse_installed()) { mouse(3,0,0,0); *x = regs.h.cx/8; *y = regs.h.dx/8; if (SCREENWIDTH == 40) *x /= 2; } }
/* ----- set mouse travel limits ------- */ void set_mousetravel(int minx, int maxx, int miny, int maxy) { if (mouse_installed()) { if (SCREENWIDTH == 40) { minx *= 2; maxx *= 2; } mouse(7, 0, minx*8, maxx*8); mouse(8, 0, miny*8, maxy*8); } }
/* --------- hide the mouse cursor ------- */ void hide_mousecursor(void) { if (mouse_installed()) { mouse(2,0,0,0); } }
/* --------- display the mouse cursor -------- */ void show_mousecursor(void) { if (mouse_installed()) { mouse(1,0,0,0); } }