xHarbour Reference Documentation > Command Reference |
Associates a key with a procedure.
SET KEY <nInkeyCode> TO [<ProcedureName>]
The SET KEY command associates a key with a procedure. The procedure is executed automatically when the key is pressed during a wait state. A wait state is employed by functions and commands that wait for user input, except for the Inkey() function. This includes the AChoice(), DBEdit(), MemoEdit() functions, and the ACCEPT, INPUT, READ and WAIT commands.
The associated procedure receives as parameters the return values of ProcName(), ProcLine() and ReadVar().
Notes: SET KEY is a compatibility command superseded by the SetKey() function.
The F1 key is automatically associated with a procedure named HELP at program start. If such a procedure is linked, it is executed when F1 is pressed during a wait state.
See also: | Inkey(), KEYBOARD, LastKey(), PROCEDURE, ProcLine(), SetKey() |
Category: | SET commands |
Header: | Inkey.ch |
Source: | rtl\setkey.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// Refer to the SetKey() function for an example.
http://www.xHarbour.com