home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 1.ddi / MOUSE.ZIP / README < prev   
Encoding:
Text File  |  1990-07-11  |  3.1 KB  |  114 lines

  1. I was playing with a Shareware product, but it was broke, so I used this
  2. better PD package, but changed the function names to match what I was using
  3. in the program already.
  4.  
  5. Special thanks to Rodney Loos, who wrote this code!
  6.  
  7. Source:
  8.  
  9. m_condit.c     m_graph_.c     m_locate.c     m_ratio.c      m_status.c
  10. m_displa.c     m_init.c       m_motion.c     m_releas.c     m_text_c.c
  11. m_event.c      m_light_.c     m_press.c      m_speed.c      m_window.c
  12.  
  13. Transfer mouse.h to your \tc\include directory.
  14. Transfer the resulting .lib's to your \tc\lib directory.
  15.  
  16. Use "make -DMODEL=m" for medium, "MODEL=l" for large, etc
  17.  
  18. ---
  19.  
  20. m_init allocates a structure which contains mouse position and status
  21. information.  The other routines will return references or store data
  22. to this structure:
  23.  
  24. struct    {
  25.     unsigned buttons;    /* button status             */
  26.     unsigned cury;        /* last column pos           */
  27.     unsigned curx;        /* last row position         */
  28.     unsigned count;        /* button event count        */
  29.     unsigned display;    /* cursor status 1=ON 0=OFF  */
  30. } M_POS;
  31.  
  32. The global __Mptr is used to reference this structure.
  33.  
  34. Functions
  35. ---------------------------------------------------------------------------
  36. int    m_init(void);
  37.  
  38.     Returns 0 if mouse software not installed.
  39.     Returns 2 if MS-DOS version < 2.0
  40.  
  41. M_POS    *m_press(int button);
  42.  
  43.     Interrogates the mouse internal button counter and updates structure
  44.  
  45. M_POS    *m_release(int button);
  46.  
  47.     Interrogates the mouse internal button counter and updates structure
  48.  
  49. M_POS    *m_status(void);
  50.  
  51.     Interrogates the mouse internal counters and updates structure
  52.  
  53. void    mouse(Param *mptr);
  54.  
  55.     Low level routine used by all functions.
  56.  
  57. void    m_display(int on_off);
  58.  
  59.     Mouse pointer is default ON, this function allows toggling
  60.  
  61. void    m_locate(int x, int y);
  62.  
  63.     Move mouse display pointer (pixels), doesn't update structure
  64.  
  65. void    m_text_cursor(int cursor_type, int cursor_attr1, int cursor_attr2);
  66.  
  67.     cursor_type is 0/Software or 1/Hardware.  See mouse.doc
  68.  
  69. void    m_graph_cursor(int x_hot, int y_hot, void far *cmask);
  70.  
  71.     Allows you to custom design a mouse cursor and its "Hot" spot.
  72.     cmask is a far pointer to an array of 32 integers (16 bits each).
  73.     16 Integers for screen mask, 16 for cursor mask.  See mouse.doc
  74.  
  75. void    m_conditional(int ux, int uy, int lx, int ly);
  76.  
  77.     Turns off mouse cursor if within limits.
  78.  
  79. void    m_window(int left, int top, int right, int bottom);
  80.  
  81.     Sets the limits for the mouse to travel
  82.  
  83. void    m_light_pen(int on_off);
  84.  
  85.     Light pen emulation, default on.
  86.  
  87. void    m_motion(int *x, int *y);
  88.  
  89.     Reads the mouse internal motion counters.
  90.  
  91. void    m_event(unsigned mask, void (far * func)(void));
  92.  
  93.     Allows a function to execute on detection of the selected mask.
  94.     See mouse.doc, and Turbo-C interrupt explanation.
  95.  
  96. void    m_ratio(int x, int y);
  97.  
  98.     Sets the vertical and horizontal mickey/pixel ratio.
  99.  
  100. void    m_speed(int x);
  101.  
  102.     Sets a mickey speed where the mouse cursor movement is doubled.
  103.  
  104.  
  105. ---
  106.  
  107. See mouse.doc for more information.
  108.  
  109. ---
  110.  
  111. I included a little program which uses the mouse (esm.c).
  112.  
  113. ...
  114.