Function GetApplyKey() Foundation

Applies the key code result of Inkey() to the current Get object.

GetApplyKey( <oGet>, <nKey> ) --> xReturn
<oGet> must be the Get object that has focus so that the keystroke can be applied.
<nKey> is the Inkey() key code which is to be applied to <oGet>.

The return value of GetApplyKey() is always NIL.


GetApplyKey() implements the default behavior of applying Inkey() codes to Get objects. It is a compatibility function which has been superseded by the combination of GetHandleEvent() and AppEvent(). Switching between reading the keyboard with Inkey() and reading events with AppEvent() can be done by calling GetEnableEvents(.T.|.F.).

Explicitly calling GetApplyKey() is usually not needed when working with Get objects, because it is called automatically within the Xbase++ Get system as soon as a key is pressed.

The default input behavior of Get objects can be changed with a user-defined Get reader. To use your reader, set the oGet:readerinstance variable to a code block that calls your reader function. Within the reader, the default handling of specific input keystrokes can be redefined. Keys not handled by the reader can be handled in the default manner using GetApplyKey() (see example).

If <nKey> is assigned to a SetKey() code block, the code block is executed and the key is not applied to the Get object (see GetDoSetkey()).

GetApplyKey() usage
// An extensive example of using GetApplyKey() to change the default 
// Get system behavior can be found in the GetReader() function. 

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.