home *** CD-ROM | disk | FTP | other *** search
/ PC Plus 36 / ISSUE_36_SEP_1989 / UTILS / MOUSEMAN.DOC < prev    next >
Encoding:
Text File  |  1989-01-01  |  12.7 KB  |  364 lines

  1.  
  2.                                       MM
  3.                                      ~~~~
  4.                 Mouse Manager (c) Colin J Smith November 1988
  5.  
  6.  
  7.                                   Files on disk
  8.                                 ~~~~~~~~~~~~~~~
  9.                 MM.EXE  ; the program to manage the mouse
  10.                 MM.C    ; 'C' source code
  11.                 MM.DOC  ; this file
  12.              MTEST.BAT  ; batch file to test operation of MM.EXE
  13.  
  14.  
  15.     MM   was  written  in  the 'C' language.   The  'C'   source   is
  16.     included and should compile in 'Borland Turbo C', 'Microsoft  C',
  17.     or 'Zortech C++'.
  18.  
  19.  
  20.     MM will be useful when you wish to quickly and easily temporarily
  21.     override  the  NVR mouse settings.  When used in batch  files  MM
  22.     will allow you to flexibly manage your mouse and prevent you from
  23.     pulling out your dusty copy of NVR too often.
  24.  
  25.  
  26.     It  is  designed to work with batch files  interfaced  using  the
  27.     ERRORLEVEL.   Users can create their own customised  batch  files
  28.     which will  allow them  set certain mouse  characteristics before
  29.     running a program that will use the mouse.
  30.  
  31.  
  32.     To look at the list of options available issue the command:-
  33.  
  34.               MM <RETURN>    ; this will display the usage
  35.  
  36.  
  37.     To set an option use:-
  38.  
  39.               MM o n ..      ; where 'o' is the option and 'n..'
  40.                              ; are the arguments which a particular
  41.                              ; option may require
  42.  
  43.  
  44.  
  45.                                  Using MTEST.BAT
  46.                                 ~~~~~~~~~~~~~~~~~
  47.  
  48.     MTEST.BAT is a batch file program which shows the typical
  49.     applications for which MM can be used.
  50.  
  51.     To run MTEST use:-
  52.  
  53.               MTEST <Return>
  54.  
  55.  
  56.     MTEST may be slow  depending on the area of the floppy disk it is
  57.     positioned  because  it needs to  access MM.EXE  a few times.  In
  58.     your  own  programs  you may  only access  MM.EXE a few times  so
  59.     this  should not be a problem.  If your batch files  will  access
  60.     MM.EXE  a  great  deal then you  should  either  put  MM.EXE onto
  61.     a 'ramdisk' or your hard disk to offer best efficiency.
  62.  
  63.  
  64.     MM is ideal to  insert in your  AUTOEXEC.BAT file so that you can
  65.     for instance set the mouse movement so it is ready after booting.
  66.  
  67.  
  68.                            Using the ERRORLEVEL value
  69.                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70.  
  71.     MM returns an ERRORLEVEL value depending on the option chosen which
  72.     can be used by batch files:-
  73.  
  74.     batch file extract,
  75.  
  76. MM 1                             ; batch file runs MM to reset mouse
  77. IF ERRORLEVEL==255 GOTO NOMOUSE    ; no mouse
  78. IF ERRORLEVEL==3 GOTO 3BUT      ; mouse has 3 buttons
  79. IF ERRORLEVEL==2 GOTO 2BUT      ; mouse has 2 buttons
  80. IF ERRORLEVEL==1 GOTO 1BUT       ; if the ERRORLEVEL return value was 1
  81.                 ; then it means a mouse was installed and
  82.                 ; it had 1 mouse button
  83.  
  84.  
  85.     The method of checking the mouse is to run MM and then using
  86.     ERRORLEVEL to determine the result and acting accordingly.
  87.  
  88.     You don't have any excuse for writing those batch files now!,
  89.  
  90.     Enjoy!
  91.  
  92.  
  93.                          T H E   O P T I O N S
  94.                             ~~~~~~~~~~~~~~~~~~~~~~~
  95.  
  96.     1  Check and reset mouse
  97.     ------------------------
  98.  
  99.     This option checks the mouse driver to see if it is present.   If
  100.     the  driver is present then the mouse settings are reset and  the
  101.     number of buttons on the mouse is returned.
  102.  
  103. --ERRORLEVEL returns
  104.  
  105. 255 - no mouse driver
  106.   1 - mouse is installed, has 1 button
  107.   2 - mouse is installed, has 2 buttons
  108.   3 - mouse is installed, has 3 buttons
  109.  
  110.  
  111.     2  Set mouse cursor status
  112.     --------------------------
  113.  
  114.     This option allows you to turn the mouse cursor either on or off.
  115.     eg.
  116.               MM 2 1    ; turns cursor ON (show)
  117.  
  118.               MM 2 0    ; turns cursor OFF (hide)
  119.  
  120.     This option is cumulative ie if you call the 'show' option  twice
  121.     in succession then it will require two calls of the 'hide' option
  122.     to turn the mouse cursor off again.
  123.  
  124.  
  125.     3  Set light pen emulation status
  126.     ---------------------------------
  127.  
  128.     This is a nice option which allows the mouse to act like a  light
  129.     pen and so maintain a degree of compatibility with software which
  130.     uses  or expects a light pens for input.  When using this  option
  131.     you must specify whether you require emulation to be ON or OFF.
  132.     eg.
  133.               MM 3 1    ; turns light pen emulation ON
  134.  
  135.               MM 3 0    ; turns light pen emulation OFF
  136.  
  137.     If you turn emulation on then:-
  138.  
  139.                 simulate PEN DOWN by
  140.                --------------------
  141.                pressing <LEFT> and <RIGHT> mouse buttons together
  142.  
  143.           simulate PEN UP by
  144.                ------------------
  145.                releasing all buttons
  146.  
  147.  
  148.     4  Get button status
  149.     --------------------
  150.  
  151.     This option checks a specified mouse button to see if it is being
  152.     pressed.   You specify the mouse button to check, either  <LEFT>,
  153.     <RIGHT>  or <CENTRE>.  The buttons are identified as  1-Left,  2-
  154.     Right  and  3-Centre.   An errorlevel  is  returned  telling  you
  155.     whether the button was pressed or not.
  156.     eg.
  157.               MM 4 1    ; looks at status of <LEFT> mouse button
  158.  
  159.               MM 4 2    ; looks at status of <RIGHT> mouse button
  160.  
  161.               MM 4 3    ; looks at status of <CENTRE> mouse button
  162.  
  163. --ERRORLEVEL returns
  164.  
  165. 0 - button NOT depressed
  166. 1 - button depressed
  167.  
  168.  
  169.     5  Wait for button
  170.     ------------------
  171.  
  172.     This  option is similar to option 4 - get button  status,  except
  173.     for  the  fact that this option waits until the  specified  mouse
  174.     button  is pressed.  You specify the button you wish to wait  for
  175.     1-Left, 2-Right or 3-Centre.
  176.     eg.
  177.               MM 5 1    ; waits until <LEFT> button is pressed
  178.  
  179.               MM 5 2    ; waits until <RIGHT> button is pressed
  180.  
  181.               MM 5 3    ; waits until <CENTRE> button is pressed
  182.  
  183.     You should be careful if you are using this option on two  button
  184.     mice, such as the one supplied with the Amstrad computers.   They
  185.     have only <LEFT> and <RIGHT> mouse buttons, so it is not possible
  186.     for you to wait for the <CENTRE> button to be pressed because  it
  187.     doesn't exist - therefore you will crash the system.
  188.  
  189.  
  190.     6  Set acceleration speed threshold
  191.     -----------------------------------
  192.  
  193.     The  acceleration speed threshold is measured in  mickeys/second.
  194.     When  moving  the  mouse cursor around the screen  the  speed  of
  195.     acceleration is detected.  You can use this option to change  the
  196.     threshold  level which if exceeded means a  coarser  mickey/pixel
  197.     ratio is used.
  198.     eg.
  199.               MM 6 100 ; sets the acceleration threshold ratio
  200.  
  201.     Low values give a jerkier/faster response eg 1.
  202.     Large values give a slower/slugish response eg 10000.
  203.  
  204.  
  205.     7  Set hardware cursor scanline
  206.     -------------------------------
  207.  
  208.     This option allows the shape of the text mode mouse cursor to  be
  209.     changed.   You  must specify the start and finish of  the  cursor
  210.     scanlines.  These will be different for different screen modes ie
  211.     colour - 0 7,  monochrome - 0 14, will set a block shape cursor.
  212.     eg.
  213.               MM 7 0 7  ; sets block cursor on colour CGA monitor
  214.  
  215.               MM 7 0 14 ; sets block cursor on monochrome monitor
  216.  
  217.  
  218.     8  Set X & Y motion/pixel ratio
  219.     -------------------------------
  220.  
  221.     This  option  allows you to change the scaled movement  over  the
  222.     screen  ie the motion to pixel ratio (how much the cursor on  the
  223.     screen moves in relation to the physical movement of the  mouse).
  224.     This  ratio is measured in 'mickeys' - the number of  pixels  per
  225.     inch.   Quality  mice usually have a mickey ratio  of  200  which
  226.     means  they have a greater degree of accuracy and  response  over
  227.     mice with say a 100 mickey ratio.
  228.     eg.
  229.               MM 8 50 100      ; sets X to 50 mickeys/Y to 100 mickeys
  230.  
  231.     The value of the Y ratio is twice that of the X ratio to maintain
  232.     uniform movement ie X ratio = 1:1, Y ratio = 2:1.
  233.  
  234.     Low values  such as 1 give quick  large movement movement  on the
  235.     screen to small movement of the mouse.
  236.     Large  values such as 100 give small movement on  screen to large
  237.     movement of the mouse.
  238.  
  239.  
  240.     9  Set New Min & Max X position
  241.     -------------------------------
  242.  
  243.     This option allows you to set the minimum and maximum  horizontal
  244.     movement boundary.  The default are:-
  245.  
  246.               min X = 0      max X = 639
  247.  
  248.         measured in terms of pixel positions.
  249.  
  250.  
  251.         pixel position 0   7  15  23  31                          631 639
  252.                 column 0   1   2   3   4...........................78  79
  253.                            ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  254.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  255.                    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  256.                    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  257.                    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  258.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  259.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  260.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  261.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  262.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓X▓REGION▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  263.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  264.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  265.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  266.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  267.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  268.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  269.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  270.                                ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  271.                              MinX                                  MaxX
  272.  
  273.     The  positions are in terms of pixel positions, so when  in  text
  274.     mode  you calculate the pixel positions by multiplying  the  text
  275.     column by 8 and subtracting 1.
  276.     eg.
  277.  
  278.     To  set  the minimum X position to start at column  10  and  then
  279.     finish at the maximum X position at column 70:-
  280.  
  281.           min X =     10 * 8 - 1   =    79
  282.  
  283.                   max X =     70 * 8 - 1   =    559
  284.  
  285.     issue the command:-
  286.  
  287.               MM 9 79 559    ; sets min X position to column 10 and
  288.                              ; max X position to column 70
  289.  
  290.         Where the X region and Y regions overlap is the possible region
  291.     where you can move the mouse cursor.  Set the Y region with the
  292.     option 10.
  293.     eg.
  294.               MinX  MaxX
  295.             |    |
  296.             ░░░░░░
  297.                         ░░░░░░                                ___MinY
  298.         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  299.         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  300.         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  301.         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  302.         ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒___MaxY
  303.                         ░░░░░░
  304.                         ░░░░░░
  305.                         ░░░░░░
  306.                         ░░░░░░
  307.  
  308.  
  309.         ▓▓ = region where mouse cursor can be moved
  310.  
  311.  
  312.     To reset the minimum and maximum positions the mouse can move
  313.     on the screen use option 1 - reset mouse OR just supply some
  314.     new values to option 9 and 10.
  315.     eg.
  316.         MM 9 0 639      ; set min/max to original
  317.  
  318.         MM 10 0 199    ; set min/max to original
  319.  
  320.  
  321.     10  Set New Min & Max Y position
  322.     --------------------------------
  323.  
  324.     This  option allows you to set the minimum and  maximum  vertical
  325.     movement boundary.  The default are:-
  326.  
  327.               min Y = 0      max Y = 199
  328.  
  329.         pixel
  330.     pos. col
  331.           0   0                                                          MinY
  332.       7   1  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  333.          15   2  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  334.           .  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  335.           .  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓Y▓REGION▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  336.               .  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  337.              23  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  338.          24  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓MaxY
  339.         199  25
  340.  
  341.  
  342.     The  positions are in terms of pixel positions, so when  in  text
  343.     mode  you calculate the pixel positions by multiplying  the  text
  344.     column by 8 and subtracting 1.
  345.     eg.
  346.  
  347.     To  set  the  minimum Y position to start at column  5  and  then
  348.     finish at the maximum Y position at column 20:-
  349.  
  350.           min Y =      5 * 8 - 1   =    39
  351.  
  352.           max Y =     20 * 8 - 1   =    159
  353.  
  354.     issue the command:-
  355.  
  356.                 MM 10 39 159   ; sets min Y position to column 5 and
  357.                                  ; max Y position to column 20
  358.  
  359.     Usually this option would be used in conjuction with option 9 to
  360.     set up a mouse movement 'window' which is where the X and Y regions
  361.     overlap.
  362.  
  363.     -----------------------------------------------------------------
  364.