home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c100 / 1.ddi / MOUSE.ZIP / M_EVENT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-11  |  809 b   |  35 lines

  1. /*
  2.  *    m_event.c
  3.  *
  4.  *    Public Domain (p) March 1990 By Rodney Loos
  5.  *    Syntax modified by S. Sampson
  6.  */
  7.  
  8. #include <dos.h>
  9. #include "mouse.h"
  10.  
  11. /*
  12.  *    Define a subroutine to be executed conditionally
  13.  *    by the mouse software
  14.  */
  15.  
  16. void m_event(unsigned mask, void (far * func)(void))
  17. {
  18.     _ES = FP_SEG(func);    /* segment of function */
  19.     _DX = FP_OFF(func);    /* offset of function  */
  20.     _CX = mask;        /* condition call mask */
  21.     _AX = 12;        /* mouse function 12   */
  22.  
  23.     geninterrupt(0x33);    /* mouse function call */
  24.  
  25.       /*
  26.      *    NOTE: The subroutine called must do a far return.
  27.      *      on entry to the subroutine:
  28.      *
  29.      *    ax contains the condition mask
  30.      *    bx contains the button state
  31.      *    cx contains the horizontal cursor coordinate
  32.      *    dx contains the vertical cursor coordinate
  33.      */
  34. }
  35.