Dec 192017
 
E-Z mouse C library. Includes OBJ file.
File TC_MOUSE.ZIP from The Programmer’s Corner in
Category C Source Code
E-Z mouse C library. Includes OBJ file.
File Name File Size Zip Size Zip Type
MOUSE.DOC 7143 2789 deflated
MOUSE.H 482 219 deflated
MOUSE.OBJ 4163 2272 deflated

Download File TC_MOUSE.ZIP Here

Contents of the MOUSE.DOC file


Mouse Library, for TC v1.++
Written and Compiled by Tony Harrison,
All rights reserved.
Copyright 1992.



E-Z Mouse

Have you ever been programming, and thought, My wouldn't mouse
support for this be just great!. I did, so I wrote a mouse library,
that I now use almost all the time. And here it is for you to use.
And since, I really despise the use of CrippleWare to ensure registration,
I didn't use it. This is, however, ShareWare. This library is not free,
but you are free to use it.

BTW: It uses INT 33, and only works with MicroSoft compatible mice.



REGISTRATION

Ugh! I know, registration is a pain in the butt. But, hey, what
other than money is going to get me to finish and release my other TC
applications?
Ok, here's the deal. You are free to distribute this software, in
its original form.. ie. all the files in the zip. You are free to incorporate
it into any application you make and distribute that application royalty free.
However, you many not distribute this, or any other related files, with your
application.
With registration you will recieve:
A disk containing:
Full documentation.
The source code, liberally commented, so anyone can understand.
Lib and Obj files for all the memory sizes
(unregistered users only get Small)
The ability to remove the annoying little comment that
this is an unregistered copy.
A set of premade graphical cursors.
And, A substantial rebate on any and all products to come.

Registration is only $10 + $4.95 Shiping/Handling.



And now for something completely different!








Reference: (in alphabetical order)







int but_press(b_type button, m_type *mouse)

See Also:
b_type, m_type
but_reles

Returns:
0> If specified button pressed, returns number of times
since last function call.
0: If button not pressed.




int but_reles(b_type button, m_type *mouse)

See Also:
b_type, m_type
but_press

Returns:
0> If specified button has been released, returns number
of times it has been released since last call.
0: If button hasn't been released;




void define_graph(int segment, int offset, int hotx, int hoty)

See Also:
graphics.h


This function allows you to define the type of graphical cursor
that you will use. If you initialize a graphics mode, and use the
mouse a default mouse cursor will be used(same one used by MS Windows)
The segment and offset are those of the bitmaps for the cursor, and
its mask. hotx and hoty are the cursor hot spots. You will recieve
full documentation of this with registration, and a set of premade
cursors.



void get_ch(char *ch, char *attr)

See Also:
conio.h
textattr(char attr)
put_ch(char ch, char attr)

This function returns the character and its attribute, at the current
cursor location.


void hidemouse()

See Also:
showmouse()

Well, you guessed it, this function hides the mouse.



void Hrange(int min, int max)

See Also:
Vrange(int min, int max)

This function defines the min and max Horizontal values that
the mouse can move inside of.




void mousecurs(int start, int end)

This function changes the hardware cursor. start is the start scan
line, end is the end scan line.


void mousestat(m_type *mouse)

See Also:
m_type

This function returns the postion of the mouse, and the button
pressed.


void put_ch(char ch, char attr)

See Also:
get_ch(char *ch, char *attr)

This function puts the desired character at the current cursor
location, with the given attribute.


int resetmouse(m_type *mouse)

See Also:
m_type

Return:
0: Mouse not installed.
1: Mouse installed.

This function resets INT 33, and returns the current mouse status.
If the Lib is unregistered, when 0 is returned a message is printed,
asking for registration. Then again, the same thing happens when it
returns 1, but this one is almose to fast to see.





void showmouse()

See Also:
hidemouse()

This shows the mouse.


void move_cur(int x, int y)

This function moves the mouse cursor to x,y



void Vrange(int min, int max)

See Also:
Hrange( int min, int max)

Sets Vertical range for mouse.






Variables and structures:

Macros:
X(a), Y(a): convert x,y values to text size.
When mousestat(&mouse) is called
the function recieves the cursor postion
in 640x400, so it uses these to convert
it to 80x25.

b_type: is an enumeration
Left=0
Right=1
Both=2
None=3
m_type: is the mouse structure:
b_type button /*button pressed */
int x,y /*postion */





These functions are all straight forward. To do something like a drag:
if(mouse.button==Left)
while(!but_reles(Left, &mouse)) {
.....
.....
}
For clicking on a specific point:
if((mouse.button==Left) && (mouse.x==1)) {
...
...
}
Note: mousestat(&mouse) should be called in the main body of the control
loop.


while(mouse.button!=Both){
mousestat(&mouse);
... /*series of checks */
...
}
return 0;
For double clicks, and so forth, but_press returns the number of times,
so:

if((but_press(Left,&mouse)==2) && (mouse.x==1) &&(mouse.y==2))
{
....
...
...
}


I included the get_ch and put_ch so that you can do marking type functions
ie.
if(mouse.button==Left)
while(!but_reles(Left,&mouse)) {
mousestat(&mouse);
hidemouse()
gotoxy(mouse.x, mouse.y);
get_ch(&ch, &attr);
textattr(attr|16); /*make background blue */
put_ch(ch, attr);
showmouse();
}

Note: Before doing any screen updating, any screen output, hide the mouse
otherwise you will get mouse droppings.


Simple enough!







You can send your registration(checks only, made out to Tony Harrison)

Tony Harrison (Registration)
7101 RollingForest Ave.
Springfield, Va. 22152
USA (incase you happen to be in another country...add $5 to
shiping/handling)

Make sure you tell me what you're registering.




Items slated for future release:

Complete Text and graphical windows /w mouse support.
(release date Sep '92)
TSR libraries (release date Dec '92)
SoundBlaster Libs, complete with record/play back
etc. (release date ????)
Modem library...(God knows when!)






Well thankyou and enjoy...


BTW I can be reached on many Northern Virginia boards as "V for Vendetta"













 December 19, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)