home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / KMOUSE10.ZIP / READ.ME < prev    next >
Text File  |  1989-10-05  |  6KB  |  130 lines

  1.                                     KMOUSE
  2.  
  3.  
  4.         KMouse is a Turbo Pascal Micorsoft/Logitech Mouse handler
  5.         that enables text based programs to use a mouse with a minimal
  6.         amount of effort by the programmer.  Simply add Kmouse to
  7.         your USES statement and your program is 'Mouseified.'
  8.  
  9.         In a nutshell, KMOUSE offers the following features:
  10.  
  11.         o  Inserts mouse movement and button press keys directly
  12.            into the keyboard buffer.
  13.         o  Programmable Key simulation for each button.
  14.         o  Programmable delays for vertical and horizontal mouse
  15.            movements.  Makes menus feel more natural.
  16.         o  The mouse event handler is programmed in assembler for
  17.            fastest possible execution speed.
  18.         o  The mouse entry state is restored upon exit if the mouse
  19.            driver (Mouse.Sys, or Mouse.Com) is Version 6.0 or greater.
  20.         o  Designed to quickly  interface with existing text based
  21.            applications.
  22.         o  Compatible with Turbo Pascal Versions 4.0 to (as of the
  23.            present) 5.5.
  24.  
  25.         Files included:
  26.         KMouse.PAS      - Unit driver for the mouse.
  27.         TestKmou.PAS    - Demo program.
  28.         Keymous.ASM     - Assembley language mouse event handler.
  29.         KeyMous.OBJ     - Object file linkable to KMouse.
  30.         Read.ME         - This file.
  31.  
  32.         The Mouse Interface:
  33.         {  Exposed to the programmer Using this Unit }
  34.  
  35. InterFace
  36.  
  37. Const
  38.   HasMouse : Boolean = False;
  39.   { Set to True if mouse found during initialization }
  40.   MouseVerified : Boolean = False;
  41.   { Set to True if the mouse reset function finds the mouse }
  42.   GoodMouse : Boolean = False;
  43.   { Set to True if Mouse driver is Ver. 6 or higher }
  44.  
  45.   {Mouse Motion Masks}
  46.   MoveRight = $01;
  47.   MoveLeft  = $02;
  48.   MoveDown  = $04;
  49.   MoveUp    = $08;
  50.   MoveAll   = $0F;
  51.   { The default is MoveAll }
  52.  
  53.   {Mouse Report masks}
  54.   MouseMoved      = $01;
  55.   MouseLBPressed  = $02;
  56.   MouseLBReleased = $04;
  57.   MouseRBPressed  = $08;
  58.   MouseRBReleased = $10;
  59.   MouseMBPressed  = $20;
  60.   MouseMBReleased = $40;
  61.   { The default is MouseMoved }
  62.  
  63.  
  64. Procedure ResetMouse;
  65. {Performs hardware reset on the mouse, sets Mouse verified}
  66.  
  67. Procedure InitMouse(Mask:Word);
  68.  
  69. { InitMouse installs the mouse handler to the mouse.  It must be called  }
  70. {  during program initialization, although additional calls are harmless }
  71. {  and may be used to change the interrupt mask.                         }
  72. {   Mask is the mask passed to the mouse driver to define the Mouse      }
  73. {  actions to report on.  This Word is bit encoded as follows:           }
  74. {                                                                        }
  75. {      15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00                   }
  76. {       0  0  0  0  0  0  0  0  0  x  x  x  x  x  x  x                   }
  77. {       -------------------------  ^  ^  ^  ^  ^  ^  ^                   }
  78. {                   ^              |  |  |  |  |  |  Mouse motion        }
  79. {                   |              |  |  |  |  |  Left button pressed    }
  80. {                   |              |  |  |  |  Left button released      }
  81. {                   |              |  |  |  Right button pressed         }
  82. {                   |              |  |  Right button released           }
  83. {                   |              |  Mid Button pressed                 }
  84. {                   |              Mid button released                   }
  85. {                   Reserved, must be 0                                  }
  86. { If the bit is set (ie, 1) the mouse calls the user installed handler   }
  87. { when the event occurs.                                                 }
  88. {  Utilizing the constants above for the Mask, the call                  }
  89. {     InitMouse(MouseMoved+MouseLBReleased+MouseRBReleased);             }
  90. {  installs the handler and sets the mouse for motion, and L & R button  }
  91. {  releases.                                                             }
  92.  
  93.  
  94. Procedure SetMouseMotion(Direction : Byte);
  95. { Sets the movement directions the mouse will report on.                 }
  96. { Using the the definitions of the constants above, following the call   }
  97. {  SetMouseMotion(MoveUp+MoveDown), the mouse will report vertical motion}
  98. { Correspondingly, SetMouseMotion(MoveAll); establishes vertical and     }
  99. { horizontal mouse motion. The default is MoveAll.  Use this procedure   }
  100. { to toggle mouse response from a vertical to a horizonal menu or a      }
  101. { full screen application.                                               }
  102.  
  103. Procedure SetMouseButtons( LB,RB,MB : Word );
  104. { Causes the mouse buttons to return the specified scancodes.            }
  105. {  Should be called before first initialization, may be called anytime   }
  106. {  after to change the buttons returned scancodes.  Each button enabled  }
  107. {  by the call mask must be > 0                                          }
  108.  
  109. Procedure SetMouseDelay( VDelay, HDelay : Word);
  110. { Sets the delay count for vertical and horizontal mouse movements.  The }
  111. {  delay is read and decremented by the mouse driver and only actuated   }
  112. {  when the delay counter reaches 0.  Use this Procedure to change the   }
  113. {  mouse sensitivity for menus, etc. The default is VDelay = 3, HDelay =1}
  114.  
  115. Procedure SaveMouse;
  116. { Saves the mouse state if the mouse driver is ver. 6.0 or higher.       }
  117.  
  118. Procedure RestoreMouse;
  119. { Restores a previously saved mouse state if the mouse driver is Ver. 6.0 }
  120. {  or higher.                                                             }
  121.  
  122. { The initialization code saves the current mouse in a separate buffer and }
  123. {  restores it during the exit process.                                    }
  124. { The save/restore mouse procs may be used by a TP application before and }
  125. {  after spawning a child process, eg. in a menuing program.              }
  126. { These procedures require that GoodMouse be true, ie. the mouse driver   }
  127. {   must be ver 6.0 or higher.                                            }
  128.  
  129. (*****************************************************************************)
  130.