home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / MOGETMOV.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.4 KB  |  56 lines

  1. /**
  2. *
  3. * Name        mogetmov -- Report physical mouse motion since last
  4. *                inquiry.
  5. *
  6. * Synopsis    ercode = mogetmov(pvert,phoriz);
  7. *
  8. *        int ercode      Error return code:
  9. *                    MO_OK if successful;
  10. *                    MO_ABSENT if mouse not found.
  11. *        int *pvert      Returned mouse vertical motion
  12. *                    in mickeys.  Positive values
  13. *                    indicate motion toward the bottom
  14. *                    of the display.
  15. *        int *phoriz      Returned mouse horizontal motion
  16. *                    in mickeys.  Positive values
  17. *                    indicate rightward motion.
  18. *
  19. * Description    This function reports the physical motion of the mouse
  20. *        since the last time this function was called.  The units
  21. *        used are "mickeys", which are the units of physical
  22. *        mouse movement.  (On the Microsoft mouse, the mickey is
  23. *        1/200 inch.)
  24. *
  25. * Returns    ercode          Error return code:
  26. *                    MO_OK if successful;
  27. *                    MO_ABSENT if mouse driver not installed.
  28. *        b_mouse       Number of mouse buttons (0 if no driver).
  29. *        *pvert,*phoriz      Returned mouse motion in
  30. *                    mickeys.  Values may range from
  31. *                    -32,768 to 32,767.
  32. *
  33. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  34. *
  35. **/
  36.  
  37. #include <bmouse.h>
  38.  
  39. int mogetmov(pvert,phoriz)
  40. int *pvert,*phoriz;
  41. {
  42.     int    result;
  43.     DOSREG regs;
  44.  
  45.     regs.ax = 11;
  46.     result  = mogate(®s,®s);
  47.  
  48.     if (result == MO_OK)
  49.     {
  50.     *phoriz = regs.cx;
  51.     *pvert    = regs.dx;
  52.     }
  53.  
  54.     return result;
  55. }
  56.