home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name morange -- Set mouse range limits
- *
- * Synopsis ercode = morange(option,low,high);
- *
- * int ercode Error return code:
- * MO_OK if successful;
- * MO_BAD_OPT if hv not recognized;
- * MO_ABSENT if mouse not found;
- * MO_RANGE if low or high is out of range
- * or if low exceeds high.
- *
- * int option Dimension to limit:
- * MO_HORIZ to set horizontal limits,
- * MO_VERT for vertical limits.
- * unsigned low,high Low and high pixel limits.
- *
- * Description This function sets the limits for mouse motion in one
- * dimension (horizontal or vertical).
- *
- * If the mouse cursor is outside the range limit, the
- * cursor is immediately moved to the nearest location
- * within the limits.
- *
- * Returns ercode Error return code:
- * MO_OK if successful;
- * MO_BAD_OPT if hv not recognized;
- * MO_ABSENT if mouse driver not found;
- * MO_RANGE if low or high is out of range
- * or if low exceeds high;
- * b_mouse Number of mouse buttons (0 if no driver).
- *
- * Version 6.00 (C)Copyright Blaise Computing Inc. 1989
- *
- **/
-
- #include <bmouse.h>
-
- int morange(option,low,high)
- int option;
- unsigned low,high;
- {
- DOSREG regs;
-
- switch (option)
- {
- case MO_HORIZ: regs.ax = 7; break;
- case MO_VERT: regs.ax = 8; break;
- default: return MO_BAD_OPT;
- }
-
- if (low > high)
- return MO_RANGE;
-
- regs.cx = low;
- regs.dx = high;
- return mogate(®s,®s);
- }