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

  1. /**
  2. *
  3. * Name        moinst -- Install mouse interrupt handler unconditionally.
  4. *
  5. * Synopsis    ercode = moinst(pfunc,call_mask);
  6. *
  7. *        int ercode      Error return code:
  8. *                    MO_OK if successful;
  9. *                    MO_ABSENT if mouse not found.
  10. *
  11. *        void (far *pfunc)()
  12. *                  Function to install.
  13. *        unsigned call_mask
  14. *                  Bit mask indicating classes of
  15. *                    events that should call the
  16. *                    handler:
  17. *
  18. *                 MO_MOVE         Mouse moved.
  19. *                 MO_L_PRESS      Left   button depressed.
  20. *                 MO_L_RELEASE    Left   button released.
  21. *                 MO_R_PRESS      Right  button depressed.
  22. *                 MO_R_RELEASE    Right  button released.
  23. *                 MO_M_PRESS      Middle button depressed.
  24. *                 MO_M_RELEASE    Middle button released.
  25. *
  26. *
  27. * Description    This function installs a mouse interrupt handler.
  28. *
  29. * Returns    ercode          Error return code:
  30. *                    MO_OK if successful;
  31. *                    MO_ABSENT if mouse not found.
  32. *        b_mouse       Number of mouse buttons (0 if no driver).
  33. *
  34. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  35. *
  36. **/
  37.  
  38. #include <bmouse.h>
  39.  
  40. int moinst(pfunc,call_mask)
  41. void (far *pfunc)();
  42. unsigned   call_mask;
  43. {
  44.     DOSREG regs;
  45.  
  46.     regs.ax = 12;
  47.     regs.cx = call_mask;
  48.     regs.dx = utoff(pfunc);
  49.     regs.es = utseg(pfunc);
  50.     return mogate(®s,®s);
  51. }
  52.