xHarbour Reference Documentation > Command Reference |
Writes a string or numeric key codes into the keyboard buffer.
KEYBOARD <cString> KEYBOARD <nInkeyCode> KEYBOARD <aKeyCodes>
The KEYBOARD command first clears the keyboard buffer and then fills it with the key codes specified as character strin, numeric values or within an array. Thus, all pending key strokes are discarded before new characters are written into the keyboard buffer. They remain in the buffer until being fetched from it during a wait state in which the keyboard buffer is polled for the next key stroke.
Wait states are employed by functions and commands that wait for user input, such as Achoice(), READ or MemoEdit().
See also: | Chr(), CLEAR TYPEAHEAD, HB_KeyPut(), Inkey(), LastKey(), NextKey(), SET KEY, SET TYPEAHEAD |
Category: | Input commands |
Header: | Inkey.ch |
Source: | rtl\inkey.c |
LIB: | xhbdll.lib |
DLL: | xhbdll.dll |
// The example writes a string into the keyboard buffer so that // Memoedit() begins editing this text in a new line. PROCEDURE MAIN LOCAL cString KEYBOARD "xHarbour:" + Chr(13) + Chr(10) cString := MemoEdit() CLS ? cString RETURN
// The example does the same as the previous one but // passes an array to the KEYBOARD command. PROCEDURE MAIN LOCAL cString KEYBOARD { "xHarbour:", 13, 10 } cString := MemoEdit() CLS ? cString RETURN
http://www.xHarbour.com