[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|            KEYBOARD             |
+---------------------------------+
KEYBOARD <expC> [PLAIN]

-----------------------------------
Places data into keyboard buffer.
-----------------------------------

KEYBOARD allows the keyboard buffer to be stuffed with an arbitrary
character string.  This data remains in the buffer until FoxPro looks
for input.  At that point, the data in the keyboard buffer is read and
acted upon as if the data had been entered from the keyboard.

<expC>
        Stuffed into keyboard buffer.  Expression can be character string, key
label or set of key labels, or a UDF that returns a character
expression.  If <expC> is a key label, the key label must be enclosed in
braces and quotes, such as KEYBOARD "{CTRL+LEFTARROW}".

        The keyboard buffer can be stuffed with up to 128 keystrokes.  Once the
keyboard buffer is full, any additional keystrokes are discarded.

PLAIN
        If you have keyboard macros defined or ON KEY LABEL commands active,
you can include PLAIN to by-pass these key assignments.  PLAIN stuffs
the keyboard with the literal key character, not the key assignment.
For example, if you have assigned a routine to the "A" key with ON KEY
LABEL and "A" is included in <expC>, including PLAIN causes the keyboard
to be stuffed with the letter "A".  The routine assigned to "A" is not
executed.


        Special Key Label Assignments

Keycap
Identification          <key label>
-------------------------------

Left arrow                      LEFTARROW
Right arrow                     RIGHTARROW
Up arrow                        UPARROW
Down arrow                      DNARROW
Home                            HOME
End                                     END
PgUp                            PGUP
PgDn                            PGDN
Del                                     DEL
Backspace                       BACKSPACE
Spacebar                        SPACEBAR
Ins                                     INS
Tab                                     TAB
Shift Tab                       BACKTAB
Enter                           ENTER
F1 to F10                       F1, F2 ...

Ctrl+F1
to Ctrl+F10                     Ctrl+F1,
                                        Ctrl+F2 ...
Shift+F1
to Shift+F9                     Shift+F1,
                                        Shift+F9...
Alt+F1
to Alt+F10                      Alt+F1,
                                        Alt+F2 ...
Alt+0
to Alt-9                        Alt+0,
                                        Alt+1 ...
Alt+A
to Alt+Z                        Alt+A,
                                        Alt+B ...

Ctrl+left arrow         Ctrl+LEFTARROW
Ctrl+right arrow        Ctrl+RIGHTARROW
Ctrl+Home                       Ctrl+HOME
Ctrl+End                        Ctrl+END
Ctrl+PgUp                       Ctrl+PGUP
Ctrl+PgDn                       Ctrl+PGDN

Ctrl+A
to Ctrl+Z                       Ctrl+A,
                                        Ctrl+B ...

Right Mouse                     RIGHTMOUSE
Left Mouse                      LEFTMOUSE
Mouse                           MOUSE
Escape                          ESC

+---------------------------------+
|             Examples            |
+---------------------------------+
In this example, an input window is displayed and the user must enter
data.  If the customer entered by the user is found in the CUSTOMER
database, the remaining fields are automatically filled by stuffing the
KEYBOARD buffer with the necessary data.

SET TALK OFF
SET SAFETY OFF
STORE SPACE(40) TO mcompany, maddress, mcomments
STORE SPACE(24) TO mcity
STORE SPACE(2) TO mstate
STORE SPACE(10) TO mzip

SELECT 1
USE customer
SET ORDER TO TAG company

DEFINE WINDOW menter FROM 7,10 TO 19,70 PANEL
ACTIVATE WINDOW menter

@ 1,3 SAY 'Company: '   GET mcompany VALID v_cust(TRIM(mcompany))
@ 3,3  SAY 'Address: '  GET maddress
@ 5,3  SAY 'City: '     GET mcity
@ 7,3  SAY 'State: '    GET mstate
@ 7,18 SAY 'Zip: '      GET mzip
@ 9,3  SAY 'Comments: ' GET mcomments
READ

DEACTIVATE WINDOW menter
USE && close database

FUNCTION v_cust
PARAMETER mcomp
SEEK UPPER(mcomp)

IF FOUND()
        KEYBOARD address1 + city + state + zip
ENDIF
RETURN .T.

-----------------------------------

See Also:  CHRSAW(), ON KEY LABEL, PLAY MACRO, SET FUNCTION

-----------------------------------

See Also: CHRSAW() ON KEY LABEL PLAY MACRO SET FUNCTION
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson