home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d6xx / d602 / mbpress.lha / MBPress / MBPress.doc < prev    next >
Text File  |  1992-02-20  |  5KB  |  116 lines

  1.  
  2.                            =====================
  3.                            = MBPress  ver  1.0 = 
  4.                            =====================
  5.  
  6.                             ---  FREEWARE  ---
  7.  
  8. ------------------------------------------------------------------------------
  9.  
  10. MouseButtonPress is a tiny command that will detect whether a mouse button
  11. (for port 1, unit 0) is currently being pressed. Is supports left, right and
  12. middle mouse buttons and will return a unique value for each combination of
  13. buttons. MBPress is for 2.04 only and was written in assembler.
  14.  
  15.     MBPress is only really suitable to run from scripts files (DOS or
  16. ARexx). That's why there is no WorkBench icon for it. Included is an example
  17. DOS script and two ARexx scripts.
  18.  
  19. ------------------------------------------------------------------------------
  20.  
  21.     Author:    Steve Anderson
  22.     Date:      February 2, 1992
  23.     Software:  DvPac and Blink
  24.  
  25. ------------------------------------------------------------------------------
  26.  
  27.     You may be wondering what use this program has. Well, it's main use
  28. is to make decisions in your script files. I personally wrote it to put
  29. near the beginning of my Startup-Sequence so when I am holding a
  30. particular mouse button (for me it's the left), a # of options come up in
  31. the form of a requestor. What you choose to do from those button presses
  32. is your choice. For instance, you could run an alternate Startup-Sequence
  33. and then break from the original one. Or you could disable your
  34. accelerator's Cache and Burst modes. You choose when to do these actions;
  35. either on a single button press or on any combination of buttons. 
  36.  
  37.     This program is quick-executing and does not loop, so multiple button
  38. presses (like double-clicks) will not be distinguished. But then this
  39. command should handle more than enough options for a script. If more
  40. options are needed, a menu program of some sort would be more appropriate.
  41.  
  42. ------------------------------------------------------------------------------
  43.  
  44.     The following are the return codes MBPress sends back to the parent
  45. console or script.
  46.  
  47.       0 for no button pressed
  48.     * 1 (001b) for lmb
  49.     * 2 (010b) for rmb
  50.       3 (011b) for lmb + rmb
  51.     * 4 (100b) for mmb
  52.       5 (101b) for lmb + mmb
  53.       6 (110b) for rmb + mmb
  54.       7 (111b) for lmb + rmb + mmb
  55.  
  56. The combinations are derived by adding the original codes for lmb, rmb and
  57. mmb (those being 1, 2, and 4).
  58.  
  59.       20 & 21 are error codes
  60.  
  61. ------------------------------------------------------------------------------
  62.  
  63.     The following is an example script using MBPress as a decision
  64. maker.
  65.  
  66.     ; example script fragment for OS 2.04 ;
  67.     ...
  68.     MBPress
  69.     Set ANSWER $RC
  70.     If $ANSWER EQ 1
  71.             Execute S:Startup-Extra
  72.     Endif
  73.     If $Answer EQ 2
  74.         C:Degrader
  75.     Endif
  76.     UnSet ANSWER
  77.     ...
  78.     ; end of example script fragment for OS 2.04 ;
  79.  
  80. ------------------------------------------------------------------------------
  81.  
  82.     MBPress was written for 2 reasons. One was because I needed a
  83. command that would do this and I couldn't find one anywhere (although I'm
  84. sure there are some others). The other reason was to brush up on
  85. my assembly coding. And it turned out to be a learning experience. I chose
  86. to access the registers directly and through resources because MBPress
  87. executes and halts very quickly. It was not worth the effort of using the
  88. system devices for a program as small and short-lived as this.
  89.  
  90.     Also, originally I planned to make MBPress 1.3 compatible but I 
  91. ran into two problems. One was the way DOS 1.3 handled return codes. I
  92. wasn't able to determine the return values from a DOS (only ARexx)
  93. without using a bulky script. The other problem was that I don't have
  94. 1.3, so the process of writing, assembling, and testing took too long. So
  95. I settled for a 2.0 only version. Sorry 1.3 owners.
  96.  
  97.     The source is commented thoroughly, so feel free to use, adapt or
  98. steal it for your own purposes. The entire archive is *** FREEWARE ***, do
  99. whatever you want with it. But I would appreciate it if the entire archive
  100. was kept together for transfering. I hope MBPress is useful for you. If 
  101. even 1 other person finds a use for it, it was worth releasing.
  102.  
  103. -----------------------------------------------------------------------------
  104.  
  105.     Many thanks to Ali Adatia, Todd Dowd and Herman Haak for
  106. beta-testing MBPress under different hardware/software configurations.
  107. I am eager to hear any comments, questions or criticisms you may have:
  108.  
  109.             Steve Anderson
  110.             58 GrayStone Drive
  111.             Hamilton, Ontario
  112.             L9C 4R8
  113.             CANADA
  114.  
  115. -----------------------------------------------------------------------------
  116.