home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
mous
/
007
/
mouse0g.doc
< prev
next >
Wrap
Text File
|
1992-05-24
|
5KB
|
99 lines
Mouse Driver for Programs that use the Cursor Keys
Answers this question:
"How can I use the mouse in my current programs?"
Purpose:
TSR makes the mouse useful in programs that don't support a
mouse. Put mouse support into C program source that uses cursor
keys. Source applys to expanded keyboard buffers. It features
"lock-on" horizontal and vertical mouse moves.
Simtel20 Title: "Biased mouse TSR emulates cursor keys /w SRC"
Version: 15 Feb 1992 [prev: 1 December 1991]
Authors: Grant B. Gustafson
113JWB Math.Dept. Univ of Utah SLC, UT 84112
Other authors will be added here as contributions are made.
email: gustafso@math.utah.edu (Internet address)
Copyright:
The source code is owned by the author. It may be used
for educational purposes without limitation. Modified versions
of the sources are considered private copies and should bear
the new authors names but not the present author's name.
Credits:
If you use this source code in your own sources, then the new
source becomes yours. You are under no obligation to give
credit or cite copyrights. If you make a change to the sources
that everyone should know about, then email a change order and
request your name to be added to the author list.
Cost:
There is no charge, license fee or obligation. If someone makes
you pay for this, then it violates the intent of the author.
Responsibility:
This computer program is used at your own risk. If you use it,
then you assume responsibility for anything that happens as a
result of the program operation, including but not limited to
programming errors, faulty operation, file system destruction.
The authors are not responsible.
SOURCE mouse0g.asm:
This program gives simple mouse support to DOS programs that use the
cursor keys. Mouse moves result in stuffing the keyboard buffer with
cursor keys. When compiled it results in a TSR program.
SOURCE mouse1g.c:
This program gives simple mouse support to DOS programs that use the
cursor keys. Mouse moves result in stuffing the keyboard buffer with
cursor keys. It is designed to be inserted into a C program source.
While functionally equivalent to mouse0g.asm, it consists of C routines
and special startup and exit routines to be called from C.
SOURCE mouse2g.asm:
Same as mouse0g.asm, except it removes itself from memory upon demand.
To understand the program source, read the source for mouse0g.asm first.
Usage:
First load the mouse driver supplied by the mouse manufacturer. Run the
TSR program and then your cursor key application. A custom specially
compiled C program using source mouse1g.c does not use the TSR and
therefore runs standalone.
Assembly of ASM source:
To assemble one of the ASM programs, use TASM or MASM to make the OBJ
file, then use TLINK /t or DOS LINK and EXE2BIN to create the COM file.
Assembly of custom C source:
To assemble the C source into your progam source, making a stand-alone
program that uses the mouse, copy the source into your program module
and then alter your source code as follows:
Startup: Call mousereset(). Call mousehook(). Mouse setup done!
Menus: If you enter a menu, where mouse action should be slower,
then call menumouse(1). On menu exit call menumouse(0).
The latter sets the mouse speed to normal.
Exit: Upon program exit call mousereset(). This resets the
mouse driver (either a device or tsr from mouse manufacturer)
interrupt service routine that was set by mousehook().
See moustest.c for a simple sample program that uses cursor keys and
also the mouse interface.
As presently written, TURBO-C is required. However, it is easy to modify
the source for assembly with MSC 6.0. Your source code must use cursor
keys, return and ESC keys in order to test all functions of the mouse
routine. In TURBO-C this means your source probably gets keyboard input
from the function getch() and you are parsing for two-byte function keys
UP==(0,H), RIGHT==(0,M), DOWN==(0,P), LEFT==(0,K). If no parsing is
done, then likely your program can recognize from the mouse only the
RETURN key and the ESC key (left and right mouse buttons).
Manual by:
Grant B. Gustafson
Last manual revision 24 May 1992