13.20. KEYBOARD/MOUSE

About
Functions order

13.20.1. About KEYBOARD/MOUSE

13.20.2. KEYBOARD/MOUSE functions order

ASC() Convert a character to its ASCII value
CHR() Convert an ASCII code to a character value
FKLABEL() Return function key name
FKMAX() Return number of function keys as a constant
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
INKEY() Extract a character from the keyboard buffer or a mouse event
LASTKEY() Return the INKEY() value of the last key extracted from the keyboard buffer
MCOL() Determine the mouse cursor's screen column position
MDBLCLK() Determine the double-click speed threshold of the mouse
MHIDE() Hide the mouse pointer
MLEFTDOWN() Determine the press status of the left mouse button
MPRESENT() Determine if a mouse is present
MRESTSTATE() Re-establish the previous state of a mouse
MRIGHTDOWN() Determine the status of the right mouse button
MROW() Determine a mouse cursor's screen row position
MSAVESTATE() Save the current state of a mouse
MSETBOUNDS() Set screen boundaries for the mouse cursor
MSETCLIP() Define an inclusion region
MSETCURSOR() Determine a mouse's visibility
MSETPOS() Set a new position for the mouse cursor
MSHOW() Display the mouse pointer
MSTATE() Return the current mouse state
NEXTKEY() Read the pending key in the keyboard buffer
SETKEY() Assign an action block to a key

13.20.2.7. Function FT_MDBLCLK()

 FT_MDBLCLK( [ <nClick> [, <nButton> [, <nInterval> [, <nRow> [, <nCol>;
 [, <nTime> ] ] ] ] ] ] ) -> lIsDoubleClk

13.20.2.8. Function FT_MDEFCRS()

 FT_MDEFCRS( <nCrsType>, <nScrMask>, <nCrsMask> ) -> NIL

13.20.2.8.3. Description

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.

13.20.2.23. Function FT_MSETSENS()

 FT_MSETSENS( <nHoriz>, <nVert>, <nDouble> ) -> NIL

13.20.2.29. Function INKEY()

 INKEY([<nSeconds>] [,<nEventMask>]) --> nInkeyCode

13.20.2.30. Function LASTKEY()

 LASTKEY() --> nInkeyCode

13.20.2.41. Function MSETCLIP()

 MSETCLIP([<nCoord list>], [<nMode>])

13.20.2.44. Function MSHOW()

 MSHOW([<nCol>, <nRow>, <nStyle>]) --> nOldCursorShape
 MSHOW([<nCursorShape>]) --> nOldCursorShape
 MSHOW([<nCursorShape>] | [<nCol>, <nRow>, <nMode>]) --> nOldCursorShape

13.20.2.45. Function MSTATE()

 MSTATE() --> aState | 0

13.20.2.45.2. Returns

 MSTATE() Return Array
 ------------------------------------------------------------------------
 Position                 Description
 ------------------------------------------------------------------------
 LLM_STATE_X              State of X position.
 LLM_STATE_Y              State of Y position.
 LLM_STATE_ROW            State of column position.
 LLM_STATE_COL            State of line position.
 LLM_STATE_LEFT           State of left mouse button.  LLM_BUTTON_DOWN
 means down and LLM_BUTTON_UP means up.
 LLM_STATE_RIGHT          State of right mouse button.  LLM_BUTTON_DOWN
 means down and LLM_BUTTON_UP means up.
 LLM_STATE_VISIBLE        State of mouse pointer.  True (.T) means
 visible and false (.F) means invisible.  (See
 MSHOW() and MHIDE() for more information.)
 LLM_STATE_DRIVER         Indicates version of mouse driver.
 LLM_STATE_SHAPE          Mouse cursor shape.  (See note below.)
 LLM_STATE_CLICKS_LEFT    Number of left clicks since last MSTATE() call.
 LLM_STATE_CLICKS_RIGHT   Number of right clicks since last MSTATE()
 call.
 ------------------------------------------------------------------------
 

Note: The following are the possible values predefined for this return array position: LLM_CURSOR_ARROW, LLM_CURSOR_SIZE_NS, LLM_CURSOR_SIZE_WE, LLM_CURSOR_SIZE_NW_SE, LLM_CURSOR_SIZE_NE_SW, LLM_CURSOR_HAND, LLM_CURSOR_FINGER, LLM_CURSOR_CROSS, LLM_CURSOR_WAIT. For a description of these values see the MSHOW() table of Cursor Shape Constants.

If the mouse is missing, 0 is returned.

The number of clicks (i.e., aState[LLM_STATE_CLICKS_LEFT] and aState[LLM_STATE_CLICKS_RIGHT]) is reset each time MSTATE() is called. Use MSTATE() to reset the mouse settings when needed.

13.20.2.46. Function NEXTKEY()

 NEXTKEY() --> nInkeyCode

13.20.2.47. Function SETKEY()

 SETKEY(<nInkeyCode>, [<bAction>]) --> bCurrentAction