home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8708 / 27 / track.c < prev   
Encoding:
C/C++ Source or Header  |  1990-07-13  |  338 b   |  22 lines

  1. /*
  2.  *  track -- track the mouse using the serial mouse routines.
  3.  */
  4.  
  5. #include "smouse.h"
  6.  
  7. main()
  8. {
  9.     Mouse m;
  10.     
  11.     if (MouseInit() < 0) exit(1);
  12.     while (!m.button[2])
  13.     {
  14.         if (MouseRead(&m) < 0) break;
  15.  
  16.         printf("dx = %4d dy = %4d b1 = %1d b2 = %1d b3 = %1d\n",
  17.             m.dx, m.dy, m.button[0], m.button[1], m.button[2]);
  18.         
  19.     }
  20.     MouseClose();
  21. }
  22.