[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
XPinkeyBlock()
Define a new handler for key-strokes
------------------------------------------------------------------------------
Function: XPinkeyBlock()
This function defines a new Handler for InKey() processing,
namely in the XPmenu() function, defined later. Note that
a seperate handler for Inkey() and Inkey(Something) had to
be defined. Contrary to what one would expect, Inkey(NIL)
is not the same as Inkey().
Using XPinkeyBlock() you can hook your Handler to the Inkey
processing of the functions in this section.
See Source code below for defaults.
Note that this handler is ONLY active in this section of
the Library!
Syntax: XPinkeyBlock(bWait,bNowait) --> {bOldW,bOldNw}
Arguments: bWait is the Inkey(nSec) or Inkey(0) handler
to install. Called with one parameter, exactly as when
the one would call Inkey(n). bNowait is called when
inkey() would be called as is.
Returns: The two previous Handlers.
Usage: Here's the source code (XPinkey() also included):
// default Keyboard handler(s):
Static bKeyWait := {|n|Inkey(n)}
Static bKeyNowait := {||Inkey()}
Function XPinkeyBlock(bWait,bNowait)
Local bW := bKeyWait, bNw := bKeyNowait
adapt bKeyWait to bWait // see EXPAND.CH
adapt bKeyNowait to bNowait
Return ({bW,bNw}) // Returns previous setting
Function XPinkey(n)
Return (if(n<>NIL,Eval(bKeyWait,n),Eval(bKeyNoWait)))
See Also:
XPinkey()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson