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

  1. /**
  2. *
  3. * Name        molitpen -- Enable or disable emulation of light pen
  4. *                by mouse.
  5. *
  6. * Synopsis    ercode = molitpen(option);
  7. *
  8. *        int ercode      Error return code:
  9. *                  MO_OK if successful;
  10. *                  MO_BAD_OPT if option not recognized;
  11. *                  MO_ABSENT if mouse not found;
  12. *
  13. *        int option      Action to perform:
  14. *                  MO_PEN    to emulate light pen.
  15. *                  MO_NO_PEN to disable light pen
  16. *                    emulation.
  17. *
  18. * Description    This function enables or disables light pen emulation.
  19. *
  20. *        When light pen emulation is enabled, pressing mouse
  21. *        buttons emulates the "pen down" state.  The mouse cursor
  22. *        location is recorded until the next button press.  When
  23. *        all mouse buttons are released, the "pen off the screen
  24. *        state" is emulated.
  25. *
  26. *        When the mouse is reset (via MORESET), it is
  27. *        automatically put into light pen emulation mode.  To use
  28. *        a light pen in addition to the mouse, you must disable
  29. *        emulation via molitpen(MO_NO_PEN).
  30. *
  31. * Returns    ercode          Error return code:
  32. *                  MO_OK if successful;
  33. *                  MO_BAD_OPT if option not recognized;
  34. *                  MO_ABSENT if mouse not found.
  35. *        b_mouse       Number of mouse buttons (0 if no driver).
  36. *
  37. * Version    6.00 (C)Copyright Blaise Computing Inc.  1989
  38. *
  39. **/
  40.  
  41. #include <bmouse.h>
  42.  
  43. int molitpen(option)
  44. int option;
  45. {
  46.     DOSREG regs;
  47.  
  48.     switch (option)
  49.     {
  50.     case MO_PEN:     regs.ax = 13;           break;
  51.     case MO_NO_PEN:  regs.ax = 14;           break;
  52.     default:     return MO_BAD_OPT;
  53.     }
  54.  
  55.     return mogate(®s,®s);
  56. }
  57.