[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
setKey(<nKey> [, <bBlock>]) --> bPrevious
Gets and optionally sets the code block indicated by <bBlock> that is
associated with the Inkey value specified by <nKey>. When replacing
an existing keypress/code block definition, it returns the previous
code block; otherwise, it returns the current one.
TBrowse:SetKey() Default Keypress/Code Block Definitions
---------------------------------------------------------------------
Inkey Value Associated Code Block
---------------------------------------------------------------------
K_DOWN { | oTB, nKey | oTB:Down(), TBR_CONTINUE }
K_END { | oTB, nKey | oTB:End(), TBR_CONTINUE }
K_CTRL_PGDN { | oTB, nKey | oTB:GoBottom(), TBR_CONTINUE }
K_CTRL_PGUP { | oTB, nKey | oTB:GoTop(), TBR_CONTINUE }
K_HOME { | oTB, nKey | oTB:Home(), TBR_CONTINUE }
K_LEFT { | oTB, nKey | oTB:Left(), TBR_CONTINUE }
K_PGDN { | oTB, nKey | oTB:PageDown(), TBR_CONTINUE }
K_PGUP { | oTB, nKey | oTB:PageUp(), TBR_CONTINUE }
K_CTRL_END { | oTB, nKey | oTB:PanEnd(), TBR_CONTINUE }
K_CTRL_HOME { | oTB, nKey | oTB:PanHome(), TBR_CONTINUE }
K_CTRL_LEFT { | oTB, nKey | oTB:PanLeft(), TBR_CONTINUE }
K_CTRL_RIGHT { | oTB, nKey | oTB:PanRight(), TBR_CONTINUE }
K_RIGHT { | oTB, nKey | oTB:Right(), TBR_CONTINUE }
K_UP { | oTB, nKey | oTB:Up(), TBR_CONTINUE }
K_ESC { | oTB, nKey | TBR_EXIT}
K_LBUTTONDOWN { | oTB, nKey | tbMouse(oTB, MROW(), MCOL()) }
---------------------------------------------------------------------
Key handlers may be queried, added, replaced, and removed from the
dictionary. For example:
oTB:SetKey(K_ESC, { | oTB, nKey | TBR_EXIT })
A default key handler may be declared by specifying a value of 0 for
<nKey>. Its associated code block will be evaluated each time
TBrowse:ApplyKey() is called with a key value that is not contained
in the dictionary. For example:
oTB:SetKey(0, { | oTB, nKey | DefTBProc(oTB, nKey) }
The example above calls a function named DefTBProc() when nKey is not
contained in the dictionary.
To remove a keypress/code block definition, specify NIL for <bBlock>.
For example:
oTB:SetKey(0, NIL }
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson