Function TBApplyKey() Foundation
Processes a key code (Inkey() value) for a TBrowse object.
TBApplyKey( <oTbrowse>, <nKey> ) --> nBrowseDirection
The function TBApplyKey() returns a numeric code which identifies the direction in which the TBrowse cursor is to be moved in the next stabilization cycle. The return value orients itself to the numeric keypad (2 means "down", 6 means "to the right" etc). When the Inkey code is not processed, the return value is zero and the Tbrowse cursor is not moved. If the key with the Inkey code <nKey> is linked to a code block via the function SetKey(), the code block is evaluated and the function returns -1.
The TBrowse function TBApplyKey() implements the default behavior of TBrowse objects for processing key codes such as those returned by the function Inkey(). It is a service function for programming with TBrowse objects and its source code is contained in the file BROWUTIL.PRG.
The default behavior for keyboard navigation of TBrowse objects implemented by the function TBApplyKey() is shown in the following table:
|Up Arrow||K_UP||Previous row|
|Down Arrow||K_DOWN||Next row up|
|Left Arrow||K_LEFT||One column to the left|
|Right Arrow||K_RIGHT||One column to the right|
|Home||K_HOME||Left column in the window|
|End||K_END||Right column in the window|
|Page Up||K_PGUP||One screen up|
|Page Down||K_PGDN||One screen down|
|Ctrl+Left Arrow||K_CTRL_LEFT||Scrolls columns to the left|
|Ctrl+Right Arrow||K_CTRL_RIGHT||Scrolls columns to the right|
|Ctrl+Page Up||K_CTRL_PGUP||First row of the table|
|Ctrl+Page Down||K_CTRL_PGDN||Last row of the table|
The return value of TBApplyKey() contains information about the direction in which the TBrowse cursor will be moved in the next stabilization cycle. Possible return values are as follows:
|Return value||Direction for TBrowse cursor|
|6||To the right|
|4||To the left|
|0||TBrowse cursor is not moved|
|-1||TBrowse cursor is not moved, because a SetKey() code block was evaluated|
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.