Places the specified character expression in the keyboard buffer.

Characters remain in the buffer until Visual FoxPro looks for keyboard input. At that point, the characters are read and output as if they were entered directly from the keyboard. You can use KEYBOARD to create self-running demonstration systems that showcase your applications.




Specifies the character expression that is placed in the keyboard buffer.

The character expression can be a character string, a key label, a set of key labels, or a user-defined function that returns a character expression. For a listing of key labels, see ON KEY LABEL Command.


If cKeyboardValue is a key label, it must be enclosed in braces and single or double quotation marks. For example:

 CopyCode imageCopy Code

To insert a pause in the keyboard buffer, you can also include the PAUSE  nSeconds option as part of the argument for cKeyboardValue where nSeconds specifies the number of seconds to pause. For example, the following lines of code insert a pause of five seconds between the strings "Hello," and "World":

 CopyCode imageCopy Code
KEYBOARD "Hello,{PAUSE 5} World"

If you have keyboard macros defined or active ON KEY LABEL commands, you can include PLAIN to bypass these key assignments. PLAIN fills the keyboard with the literal key character, not the key assignment.

For example, if you have assigned a command to the A key with ON KEY LABEL and A is included in cKeyboardValue, use PLAIN to place the letter A in the keyboard buffer. The ON KEY LABEL command assigned to A is not executed.


Empties the keyboard buffer before the keyboard buffer is filled with cKeyboardValue.

Expand imageRemarks

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic