| FT_MBUTPRS() | Retrieve button press status |
| FT_MBUTREL() | Get mouse button release information |
| FT_MCONOFF() | Turn mouse cursur off if in specified region |
| FT_MCURSOR() | Set the mouse cursor |
| FT_MDBLCLK() | Return true if a double click was detected |
| FT_MDEFCRS() | Define the mouse cursor |
| FT_MGETCOORD() | Get mouse cursor position (text coord.) and button status |
| FT_MGETPAGE() | Get the display page for the mouse pointer |
| FT_MGETPOS() | Get mouse cursor position and button status |
| FT_MGETSENS() | Get the mouse sensitivity parameters |
| FT_MGETX() | Get mouse cursor row position |
| FT_MGETY() | Get mouse cursor column position |
| FT_MHIDECRS() | Decrement internal mouse cursor flag and hide mouse cursor |
| FT_MINIT() | Initialize the mouse driver, vars and return status of mouse |
| FT_MINREGION() | Test if the mouse cursor is in the passed region |
| FT_MMICKEYS() | Get mickeys |
| FT_MRESET() | Reset mouse driver and return status of mouse |
| FT_MSETCOORD() | Position the mouse cursor using text screen coordinates |
| FT_MSETPAGE() | Set the display page for the mouse pointer |
| FT_MSETPOS() | Position the mouse cursor using virtual screen coordinates |
| FT_MSETSENS() | Set the mouse sensitivity parameters |
| FT_MSHOWCRS() | Increment internal cursor flag and display mouse cursor |
| FT_MVERSION() | Get the mouse driver version |
| FT_MXLIMIT() | Set vertical bounds of mouse using virtual screen coord. |
| FT_MYLIMIT() | Set horiz. bounds of mouse using virtual screen coordinates |
| FT_SCANCODE() | Wait for keypress and return keyboard scan code |
FT_MBUTPRS( <nButton> [, @nButPrs [, @nX [, @nY] ] ] ) -> nButStatus
| <nButton> | is the mouse button number: |
| 0 - Left Button | |
| 1 - Right Button | |
| 2 - Middle Button [if applicable] | |
| <nButPrs> | is the number of times the specified button was pressed |
| since the last call to this routine. PASSED BY REFERENCE. | |
| <nX> | is the X position of the cursor when the last press occurred. |
| PASSED BY REFERENCE. | |
| <nY> | is the Y position of the cursor when the last press occurred. |
| PASSED BY REFERENCE. | |
An integer representing the button status:
0 - no buttons pressed 1 - left button pressed 2 - right button pressed 3 - left and right pressed 4 - middle pressed 5 - left and middle pressed 6 - middle and right buttons pressed 7 - all 3 buttons pressed
Retrieves the mouse button status and the position of the cursor when a button was last pressed.
FT_MBUTREL( nButton [, @nButRel [, @nX [, @nY] ] ]) -> nBStat
| <nButton> | is the mouse button number |
| 0 - Left Button | |
| 1 - Right Button | |
| 2 - Middle Button [if applicable] | |
| <nButRel> | is the number of times the specified button was released |
| since the last call to this routine. PASSED BY REFERENCE. | |
| <nX> | is the X position of the cursor when the last release occurred. |
| PASSED BY REFERENCE. | |
| <nY> | is the Y position of the cursor when the last release occurred. |
| PASSED BY REFERENCE. |
<nBStat> - an integer representing button release status 0 - None 1 - Left 2 - Right 3 - Middle
This function returns the release status of the mouse buttons and the coordinates of the last release.
FT_MCONOFF( <nTop>, <nLeft>, <nBottom>, <nRight> )
This function tells the mouse driver to hide the cursor if it is in the given region. The driver hides the cursor by decrementing the cursor flag. A call to FT_MSHOWCRS is required to turn the cursor back on. Calling FT_MSHOWCRS also disables this function.
See FT_MSHOWCRS for a discussion of the cursor display flag.
FT_MCURSOR( [ <lState> ] ) -> lCursorState
A logical indicating the previous mouse cursor state.
This function works like most Clipper state functions. If no value is sent to FT_MCURSOR() it will return the state of the mouse cursor.
FT_MDBLCLK( [ <nClick> [, <nButton> [, <nInterval> [, <nRow> [, <nCol>; [, <nTime> ] ] ] ] ] ] ) -> lIsDoubleClk
| <nClick> | is a numeric value. If it is zero FT_MDBLCLK() will not |
| check for the first press but rather will simply wait the | |
| specified period for a single press. This is useful if this | |
| routine is called from one which in turn responded to a button | |
| press. If it is not present or not equal to 0, then FT_MDBLCLK() | |
| will wait for two presses of the specified button. | |
| <nButton> | is the mouse button number |
| 0 - Left Button | |
| 1 - Right Button | |
| 2 - Middle Button [if applicable] | |
| <nInterval> | is the interval to wait for the first click if requested |
| and the time to wait for the second. If not present then defaults | |
| to 0.5 second. | |
| <nRow> | is the row number for the mouse cursor location for a double click |
| to be valid. If not present then the current position is taken as | |
| the valid location. | |
| <nCol> | is the column number for the mouse cursor location for a double |
| click to be valid. If not present, then the current position is | |
| taken as the valid location. | |
| <nTime> | is an optional start time for the waiting period for the first |
| click (of either one or two requested). If not given then the | |
| time is set at entry into this routine. This is useful when this | |
| routine is called from another routine which was called in | |
| response to a mouse click but needs to know if a double click | |
| has occurred |
.T. if a double click was detected.
This is a mouse meta function that checks for the presence of a double click.
FT_MDEFCRS( <nCrsType>, <nScrMask>, <nCrsMask> ) -> NIL
| <nCrsType> | is the cursor type. A value of 0 indicates the software cursor |
| (the default) and a value of 1 indicates the hardware cursor. | |
| <nScrMask> | is the screen mask for the software cursor or the first scan |
| line of the hardware cursor. See the description for more | |
| information. | |
| <nCrsMask> | is the cursor mask for the software cursor of the last scan |
| line of the hardware cursor. See the description for more | |
| information. |
In text mode the mouse cursor can either be a software generated or the actual hardware cursor. This routine allows one choose between them. The software cursor is the default and its effect on the character it covers is determined by the screen mask and the cursor mask. Both of these masks are 16 bit values (which in Clipper are passed as standard numerical values). The 16 bit masks are arranged in a manner identical to the way information is stored for each character cell on the screen. The low order 8 bits represent the actual character displayed while the high order bits represent the display atributes such as blinking, intensity and forground and background colors. The mask is represented in the diagram below:
Bit: |15 |14 12|11 |10 8|7 0| Function:|blink |background|intensity|foreground|character|
Blinking and high intensity are on when the bit is 1. The background and foreground indicate which colors are used for each. The software mouse cursor uses these two values by taking the mask from the screen cell it is on and performing a logical AND on each bit with the screen mask value. The result is then logically XOR'ed with the cursor mask value. Thus to keep the character the same but invert the foreground and background colors the following values would be used:
Bit: |15 |14 12|11 |10 8|7 0| Function:|blink |background|intensity|foreground|character| screen: | 0 | 111 | 0 | 111 |11111111 | =30719 cursor: | 0 | 111 | 0 | 111 |00000000 | =30464
The hardware cursor is the text cursor provided by the video board. One specifies the range of scan lines which are on using <nScrMask> and <nCrsMask>. The range of values is dependant upon the type of monitor. The first scan line is 0.
FT_MGETPOS( @<nX>, @<nY> ) -> nButtonStatus
an integer representing button status
- 0 for no button pressed - 1 for left pressed - 2 for right pressed - 3 for left and right pressed - 4 for middle pressed - 5 for left and middle pressed - 6 for right and middle pressed - 7 for all three buttons pressed
Loads cursor position into x and y coordinates passed by reference and returns the button status.
FT_MGETPAGE() -> <nPage>
No arguments
<nPage> is the display page on which the mouse is currently being displayed
This function gets the display page for the mouse cursor. The valid values of nPage is dependent upon the display mode. See FT_SETVPG() for changing the current video page
FT_MGETPOS( @<nX>, @<nY> ) -> nButtonStatus
an integer representing button status
- 0 for no button pressed - 1 for left pressed - 2 for right pressed - 3 for left and right pressed - 4 for middle pressed - 5 for left and middle pressed - 6 for right and middle pressed - 7 for all three buttons pressed
Loads cursor position into x and y coordinates passed by reference and returns the button status. The coordinate system in text mode has eight virtual coordinates per character cell. Thus x=16 means that you are in the Row 2. The values returned by this routine when in text mode and with mouse driver versions 6 and above are multiples of 8. We have experience with drivers prior to that version
FT_MGETSENS( <@nHoriz>, <@nVert>, <@nDouble> ) -> NIL
This function returns the current values of the mouse movement sensitivity parameters. The first two arguments control the amount of movement necessary to move the cursor a given amount. The third argument determines the threshold above which the mouse moves at twice the normal speed. For further discussion of these values see FT_MSETSENS()
FT_MGETX() -> nRowPos
No arguments
<nRowPos> which is the row position of mouse in virtual screen coordinates.
Retrieves mouse's row position in virtual screen coordinates. The values returned are multiples of 8 when in text mode and with at least Microsoft drivers 6 and above.
FT_MGETY() -> nColPos
No arguments
<nColPos> Column position of mouse in virtual screen coordinates
Retrieves mouse's column position in virtual screen coordinates. The values returned are multiples of 8 when in text mode and with at least Microsoft drivers 6 and above.
FT_MHIDECRS() -> NIL
No arguments
Hides the mouse cursor. Make sure to turn the mouse cursor off when redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to FT_MHIDECRS() require an equal number of calls to FT_MSHOWCRS() before the cursor will again be visible. Once the variable is 0 calls to FT_MSHOWCRS() does not increment the varaible above 0.
FT_MINIT() -> lMouseStatus
No arguments
An logical representing the mouse status (.F. == mouse not installed)
Initializes the mouse drive, associated variables and returns mouse status. It checks to see if the mouse has been previously initialized and if so it does not reinitialize. The row and column limits of mouse movement is set to the maximum for the current video mode. Use FT_MSHOWCRS() to display the mouse cursor.
FT_MINREGION( <nT>, <nL>, <nB>, <nR> ) -> lInRegion
.T. if mouse is in specified region.
This function will check to see if the mouse cursor is within the confines of the specified region.
FT_MMICKEYS( @<nX>, @<nY> ) -> NIL
<nX> and <nY> must be passed by reference to receive the mouse position in Mickeys.
FT_MRESET() -> nMouseStatus
No arguments
An integer representing the mouse status (0 == mouse not installed)
Resets the mouse driver and returns mouse status. Use FT_MSHOWCRS() to display the mouse cursor. The mouse is set to allow it to cover the complete screen (as defined by MAXCOL() and MAXROW()). This is necessary because at least some versions of the mouse drivers do not operate according to the documentation when confronted with a 43 or 50 line screen.
Normally, FT_MINIT() should be used to initialize the mouse since it will not reinitialize if already done.
FT_MSETPOS( <nX>, <nY> ) -> NIL
Positions mouse cursor on screen using text (normal row and column) coordinates.
FT_MSETPAGE( <@nPage> ) -> NIL
This function sets the display page for the mouse cursor. The valid values of nPage is dependent upon the display mode. See FT_SETVPG() for changing the current video page
FT_MSETPOS( <nX>, <nY> ) -> NIL
Positions mouse cursor on screen. The virtual coordinate system in text mode has eight virtual coordinates per character cell. Thus x=16 means that you are in the Row 2.
FT_MSETSENS( <nHoriz>, <nVert>, <nDouble> ) -> NIL
| <nHoriz> | is the sensitivity of the mouse on the horizontal axis. This |
| value is the integer percentage of highest sensitivity and | |
| thus has a range of 1 to 100. The default value is 50 and at | |
| this setting about 3.2 inches of mouse movement will move | |
| the mouse cursor across the screen. If NIL, the current | |
| value is used. | |
| <nVert> | is the relative sensitivity of the mouse on the vertical axis. |
| The value is an integer percentage of the highest sensitivity | |
| and thus has a range of 1 to 100. The default value is 50 and | |
| requires about 2 inches of mouse movement will move from top | |
| to bottom of the screen.If NIL, the current value is used. | |
| <nDouble> | is the relative sensitivity of the mouse to doubling the ratio |
| of cursor movement to mouse movement. The default | |
| value is 50. If NIL, the current value is used. |
This function allows one to control the mouse movement sensitivity. The first two arguments control the amount of movement necessary to move the cursor a given amount. The values are the percentage of full sensitivity and the default values after installing the mouse driver is 50 which represents approximately 3.2 inches of horizontal and 2 inches of vertical mouse movement to cover the entire screen. A value of 100 requires about 0.9 inches of horizontal mouse movement to cover the screen from one side to the other.
The third argument changes the threshold above which the mouse moves at twice the normal speed. The value is a percentage of full sensitivity with the default (50) providing doubling at 64 mickeys per second.
NOTE: These values are NOT restored after resetting the mouse driver/ hardware. A well behaved application should reset them to the original value upon exiting.
NOTE: The above description is counter to all of the documentation I have available. However, it does not work the way it is documented with Microsoft drivers versions 6.16, 6.24, 7.04 and 8.20. The above movement values are documented to be the number of mickeys per 8 pixels and the double speed value as the number mickeys per second required to double the speed. Each of these values should range from 1 to 32K but the driver forces a maximum of 100. Also the documentation states that resetting the mouse will reset these values. This is not the case.
FT_MSHOWCRS() -> NIL
No arguments
Displays the mouse cursor. Make sure to turn the mouse cursor off when redrawing screens. The mouse cursor dutifully saves the screen under it, so if you draw over the mouse cursor it will create a "hole" in your screen when you move the mouse cursor.
Note: A call to FT_MHIDECRS() decrements a mouse driver variable which indicates whether the cursor is shown. The cursor is visible only when the variable = 0. Thus multiple calls to FT_MHIDECRS() require an equal number of calls to FT_MSHOWCRS() before the cursor will again be visible. Once the variable is 0 calls to FT_MSHOWCRS() does not increment the variable above 0.
FT_MVERSION( <@nMinor>, <@nType>, <@nIRQ> ) -> <nMajor>
<nMajor> which is the major version number of the mouse driver.
This function returns the current values of the mouse driver version number and type. The major version would be 6 and the minor version would be 10 if the driver were version 6.10. The mouse type and IRQ numbers are also returned.
NOTE: It appears that the values reported when one starts the mouse driver actually have the minor version in hexadecimal! Thus on bootup my screen showed 6.24 but this routine returned 30 for the minor version number!
FT_MXLIMIT( <nX1>, <nX2> ) -> NIL
Set maximum vertical bounds of mouse using virtual screen coordinates.
FT_MYLIMIT( <nY1>, <nY2> ) -> NIL
Set maximum horizontal bounds of mouse using virtual screen coordinates.
FT_SCANCODE() -> cCode
No arguments
A two-character string, corresponding to the keyboard scan code.
FT_SCANCODE() enables you to distinguish the different scancodes of similar keys (such as Grey minus versus regular minus), thus increasing the number of keys your input routine can recognize.
It works like INKEY(), in that it waits for a key to be pressed. The scan code consists of two bytes, which are returned as a two-character string.
For example, calling FT_SCANCODE() and pressing the Grey-minus key will return a two character string:
CHR(45) + CHR(74)
LASTKEY() is not updated by FT_SCANCODE(), so don't try to test LASTKEY() to see what was pressed during an FT_SCANCODE() call. Simply assign the return value to a variable and test that (see the test driver below).
* This was adapted from a short C routine posted by John Kaster on NANFORUM. It was written in Clipper to help demonstrate the FT_INT86 function of the Nanforum Toolkit.
This program requires FT_INT86().
| Пред. | Начало | След. |
| DATE/TIME | Уровень выше | GAME |