INTRODUCTION...
MK.lib for CLIPPER provides basic and advanced functions for Mouse
programming like, using Mouse and Keyboard at the same time, user
selectable cursor shapes. MK.lib may be nested as deep as you like.

MK.lib 2.1 is $99.00 with free updates. To order MK.lib call...
Programmer's Shop 1-800-421-8006
Aries Software    1-402-292-4349

LINKERS...
MK.lib is compatible with the following.
1 plink86 2.24
2 Tlink 1.1, 3.0, 3.01
3 Blinker (All Versions)
4 Warplink 1.02
5 RTlink

MOUSE DRIVERS....
According to Microsoft, Mouse driver 6.26 is buggy and They told us
to use 6.24 or the newer 7.03 and 7.04. Driver 7.03 does a video
check and can cause erratic movement. If this happens, 7.04 loaded
with the /y switch will disable video checking. Any Mouse Microsoft
compatible will work with MK.lib.

INSTALLATION...
Simply link MK.lib into your Application. If you are using overlays
put MK.lib into the Root since you will be using the Mouse functions
throughout the Application.

NOTES...
The Mouse will return a value of 501 for the left button and 502
for the right button.

We use i as an example for a return valuein these functions.
That is not to say all functions have to be called this way. It
depends on how you want to do your error trapping. An example of
calling a function both ways...

i = mktrap(2,5,12,25)
if !i
  && code here to warn that an invalid parameter was passed.
endif

OR

mktrap(2,5,12,25)

The first call reports back if an invalid parameter was passed,
the second does not. The second will work if parameters are valid
and do nothing if they are not. Its up to your coding style.
Some functions are obvious, if you NEED a return value then the
first call is the way to go. Functions like MKRESET() just do a
task and thats all, so the second call is ok.

FUNCTIONS...
MKPRESS()
Purpose... Polls MOUSE and KEYBOARD at the same time.
Syntax.... <memvar> = mkpress()
Returns... Value of the button or key pressed.
Notes..... <memvar>, variable that holds value of mkpress()
           Can be used with just a Mouse or just a Keyboard.
Sample.... i = mkpress()
           if i = 27 .or. i = 502   && Escape key or Right button
             quit
           endif

MKSET()
Purpose... Initializes Mouse if found. Turns ON or OFF Mouse.
Syntax.... <memvar> = mkset()
Returns... .T. if mouse found else .F.
Notes..... <memvar>, variable that holds value of mkset(), Following
           an mkset() call, an error trap to warn if no Mouse Found
           should be used.
Sample.... i = mkset()
           if !i
             @ 0,0 say "MOUSE not Found"
             <code to continue without or quit to hook one up>
           endif
           Call mkset() before you Quit Your Application to DOS.

MKCURSOR()
Purpose... Turns On or Off MOUSE cursor.
Syntax.... mkcursor(<expN>)
Returns... .F. if <expN> is not 0 or 1 else .T.
Notes..... <expN> = 0 to turn cursor On or 1 to turn cursor Off.
           Turning cursor off to change screens, then on again will
           eliminate mouse tracks.
Sample.... mkcursor(0)  && Turn on cursor

MKROW()
Purpose... Gets ROW position.
Syntax.... <memvar> = mkrow()
Returns... Value of the Row when a button was pressed.
Notes..... <memvar>, variable that holds value of mkrow(). Call this
           directly after calling mkpress().
Sample.... i = mkpress()    && Get key or button press
           ii = mkrow()     && Get row
           iii = mkcol()    && Get column
           if i = 501 .and. ii = 40 .and. iii = 12
             @ 24,0 say "I'm at the center of the screen"
           endif

MKCOL()
Purpose... Gets COLUMN position.
Syntax.... <memvar> = mkcol()
Returns... Value of the Col when a button was pressed.
Notes..... <memvar>, variable that holds value of mkcol(). Call this
           directly after calling mkpress().
Sample.... See MKROW().

MKSETCURS()
Purpose... Sets the cursor at X,Y position.
Syntax.... mksetcurs(<expN1>,<expN2>)
Returns... .F. if <expN1> or <expN2> invalid else .T.
Notes..... <expN1> = Row, <expN2> = Column. Call as <Row>,<Column>.
Sample.... mksetcurs(16,64)  && Sets cursor at row 16 and column 64.

MKBTNDWN()
Purpose... Tells which button is down at time of call.
Syntax.... <memvar> = mkbtndwn()
Returns... 0 = None, 1 = Left, 2 = Right, 3 = Both.
Notes..... <memvar>, variable that holds value of mkbtndwn(). This
           is an extra function. MKPRESS() will do the same but we
           had requests for this so here it is.
Sample.... i = mkbtndwn()
           if i = 1
             @ 24,0 say "You pressed the Left button"
           endif

MKBTNPRS()
Purpose... Count times a Button was pressed since last call.
Syntax.... <memvar> = mkbtnprs(<expN>)
Returns... .F. if <expN> invalid else value of button press.
Notes..... <memvar>, variable that holds value of mkbtnprs()
           <expN> can be 0 = Left Button, 1 = Right Button. This
           sample shows number times the Left button was pressed.
Sample.... i = mkbtnprs(0)
           time = 0
           do while time # 2500
             time = time + 1  && Press button as many time as you can
           enddo              && during this loop.
           i = mkbtnprs(0)
           ? i

MKBTNRLS()
Purpose... Count times a Button was released since last call.
Syntax.... <memvar> = mkbtnrls(<expN>)
Returns... .F. if <expN> invalid else value of button releases.
Notes..... <memvar>, variable that holds value of mkbtnrls()
           0 = Left Button, 1 = Right Button.
Sample.... See MKBTNPRS().

MKTRAP()
Purpose... Traps Mouse in Horizontal and/or Vertical positions.
Syntax.... mktrap(<expN1>,<expN2>,<expN3>,<expN4>)
Returns... .F. if <expN1> thru <expN4> invalid else .T.
Notes..... <expN1>=Top,<expN2>=Left,<expN3>=Bottom,<expN4>=Right.
Sample.... i = mktrap(0,0,5,15)
           if !i
             && code here if parameter invalid
           endif
           To return to full screen mode call as...
           mktrap(0,0,24,79)
           Note we called mktrap() without i to error trap. No
           reason for this we just did not error trap that call.

MKSETSPD()
Purpose... Sets Mouse Cursor Sensitivity and Double Speed Ratio.
Syntax.... mksetspd(<expN1>,<expN2>,<expN3>)
Returns... .F. if <expN1>,<expN2> or <expN3> in valid else .T.
Notes..... <expN1>=Horizontal speed,<expN2>=Vertical speed,<expN3>
           is for setting the Double Speed ratio. 1 to 100 is the
           range for <expN1>,<expN2> or <expN3>.
Sample.... mksetspd(10,10,15)  && Slow
           mksetspd(80,80,90)  && Fast
           mksetspd(50,50,64)  && Normal speed

MKCHKSPD()
Purpose... Gets Mouse Cursor Sensitivity and Double Speed Ratio.
Syntax.... mkchkspd(<expN>)
Returns... Current Value of <expN> else .F. if <expN> invalid.
Notes..... 0 = Horizontal speed, 1 = Vertical speed, 2 = Double
           Speed ratio. Following shows Horizontal, Vertical and
           Double Speed ratio.
Sample.... H = mksetspd(0)
           ? H
           V = mksetspd(1)
           ? V
           D = mksetspd(2)
           ? D

MKMOTION()
Purpose... Count Horizontal or Vertical Mickey Motion.
Syntax.... <memvar> = mkmotion(<expN>)
Returns... Current Value of <expN> else .F. if <expN> invalid.
Notes..... <memvar>, variable that holds value of mkmotion().
           0 = Horizontal, 1 = Vertical. Values can range from
           -32768 to 32767. Right = positive, Left = negative.
           Up = negative, Down = positive.
Sample.... i = mkmotion(0)
           if i < 0
             @ 24,0 say "You moved left"
           endif

MKRESET()
Purpose... Resets Mouse Software Only.
Syntax.... mkreset()
Returns... Nothing.
Notes..... If you changed any attributes of the Mouse driver and
           want to return to normal setting, call mkreset() to do
           so without doing a hardware reset.
Sample.... mkreset()

MKFLDLOK()
Purpose... Field Encryption/Decryption
Syntax.... mkfldlok(<expC>,<expN>)
Returns... An Encrypted or Decrypted Field
Notes..... <expC> is the Character field name. <expN> = 0 to Decrypt
           and 1 to Encrypt. A blank space is returned if <expN> not
           valid. Be very CAREFUL !!! with this function.
Sample.... use testdbf                           && open database
           mfname = fldlock(fname,0)             && unlock field
           @ 2,2 say "Enter Name " get mfname    && get new data
           read                                  && read data
           replace fname with fldlock(mfname,1)  && lock field
           use                                   && close database

MKSHAPE()
Purpose... Change mouse cursor shape.
Syntax.... mkshape(<expN>)
Returns... .F. if <expN> invalid else .T.
Notes..... There are 13 shapes to choose from. They are...
           1.  Cross           8.  Right Arrow
           2.  Check           9.  Left Arrow
           3.  Asterisk        10. Up/Down Arrow
           4.  Diamond         11. Up Arrow
           5.  Hour Glass      12. Down Arrow
           6.  Small Circle    13. Standard Block (default)
           7.  Music Note
Sample.... mkshape(4)   && Change cursor to a diamond

MKRANGE()
Purpose... Tells if a button was pressed within defined range.
Syntax.... mkrange(<expN1>,<expN2>,<expN3>,<exp4>)
Returns... 0 if <expN?> invalid, .F. if not in range, .T. if in range
Notes..... <expN1>=TOP,<expN2>=LEFT,<expN3>=BOTTOM,<expN4>=RIGHT.
           if an invalid parameter is passed nothing happens. To test
           a range of row 9 by col 17 by row 11 by col 62 call as...
Sample.... if !mkrange(9,17,11,62)
             && Code here if parameter invalid
           endif
           This is much faster than and replaces MKROW(), MKCOL().
           You may also check a single point at row 3, col 14 with a
           call like...
           if !mkrange(3,14,3,14)
             && Code here if parameter invalid
           endif