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 >
Wrap
Text File
|
1992-02-20
|
5KB
|
116 lines
=====================
= MBPress ver 1.0 =
=====================
--- FREEWARE ---
------------------------------------------------------------------------------
MouseButtonPress is a tiny command that will detect whether a mouse button
(for port 1, unit 0) is currently being pressed. Is supports left, right and
middle mouse buttons and will return a unique value for each combination of
buttons. MBPress is for 2.04 only and was written in assembler.
MBPress is only really suitable to run from scripts files (DOS or
ARexx). That's why there is no WorkBench icon for it. Included is an example
DOS script and two ARexx scripts.
------------------------------------------------------------------------------
Author: Steve Anderson
Date: February 2, 1992
Software: DvPac and Blink
------------------------------------------------------------------------------
You may be wondering what use this program has. Well, it's main use
is to make decisions in your script files. I personally wrote it to put
near the beginning of my Startup-Sequence so when I am holding a
particular mouse button (for me it's the left), a # of options come up in
the form of a requestor. What you choose to do from those button presses
is your choice. For instance, you could run an alternate Startup-Sequence
and then break from the original one. Or you could disable your
accelerator's Cache and Burst modes. You choose when to do these actions;
either on a single button press or on any combination of buttons.
This program is quick-executing and does not loop, so multiple button
presses (like double-clicks) will not be distinguished. But then this
command should handle more than enough options for a script. If more
options are needed, a menu program of some sort would be more appropriate.
------------------------------------------------------------------------------
The following are the return codes MBPress sends back to the parent
console or script.
0 for no button pressed
* 1 (001b) for lmb
* 2 (010b) for rmb
3 (011b) for lmb + rmb
* 4 (100b) for mmb
5 (101b) for lmb + mmb
6 (110b) for rmb + mmb
7 (111b) for lmb + rmb + mmb
The combinations are derived by adding the original codes for lmb, rmb and
mmb (those being 1, 2, and 4).
20 & 21 are error codes
------------------------------------------------------------------------------
The following is an example script using MBPress as a decision
maker.
; example script fragment for OS 2.04 ;
...
MBPress
Set ANSWER $RC
If $ANSWER EQ 1
Execute S:Startup-Extra
Endif
If $Answer EQ 2
C:Degrader
Endif
UnSet ANSWER
...
; end of example script fragment for OS 2.04 ;
------------------------------------------------------------------------------
MBPress was written for 2 reasons. One was because I needed a
command that would do this and I couldn't find one anywhere (although I'm
sure there are some others). The other reason was to brush up on
my assembly coding. And it turned out to be a learning experience. I chose
to access the registers directly and through resources because MBPress
executes and halts very quickly. It was not worth the effort of using the
system devices for a program as small and short-lived as this.
Also, originally I planned to make MBPress 1.3 compatible but I
ran into two problems. One was the way DOS 1.3 handled return codes. I
wasn't able to determine the return values from a DOS (only ARexx)
without using a bulky script. The other problem was that I don't have
1.3, so the process of writing, assembling, and testing took too long. So
I settled for a 2.0 only version. Sorry 1.3 owners.
The source is commented thoroughly, so feel free to use, adapt or
steal it for your own purposes. The entire archive is *** FREEWARE ***, do
whatever you want with it. But I would appreciate it if the entire archive
was kept together for transfering. I hope MBPress is useful for you. If
even 1 other person finds a use for it, it was worth releasing.
-----------------------------------------------------------------------------
Many thanks to Ali Adatia, Todd Dowd and Herman Haak for
beta-testing MBPress under different hardware/software configurations.
I am eager to hear any comments, questions or criticisms you may have:
Steve Anderson
58 GrayStone Drive
Hamilton, Ontario
L9C 4R8
CANADA
-----------------------------------------------------------------------------