Command KEYBOARD Foundation
Places a character string into the keyboard buffer.
KEYBOARD <cString>
The command KEYBOARD deletes all characters currently in the keyboard buffer and writes the value of <cString> into the keyboard buffer. Characters remain in the keyboard buffer until they are read or deleted. Characters are removed from the keyboard buffer by commands like READ or INPUT, as well as functions like AppEvent(), Inkey(), AChoice() or MemoEdit().
Control characters and Inkey() codes must be converted to ASCII characters using the function Chr() before they are written into the keyboard buffer. Only Inkey() and ASCII codes from 0 to 255 can be inserted into the keyboard buffer.
// In the example, the F10 key is used as a termination key
// for MemoEdit(). It is tied to a code block and the code
// block calls the procedure MemoQuit(). MemoQuit() writes
// the default termination key Ctrl-W into the keyboard buffer.
#include "inkey.ch"
PROCEDURE Main()
LOCAL cText := MemoRead( "TEST.TXT" )
LOCAL bBlock := SetKey( K_F10, {|| MemoQuit() } )
cText := MemoEdit( cText )
MemoWrit( "TEST.TXT", cText )
SetKey( K_F10, bBlock )
RETURN
PROCEDURE MemoQuit()
KEYBOARD Chr(K_CTRL_W)
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.