xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_SetKeyArray()

Associates a code block with multiple keys.

Syntax

HB_SetKeyArray( <aInkey>, [<bCodeblock>] ) --> NIL

Arguments

<aInkey>
This is a one dimensional array. It contains the numeric codes of the keys to associate <bCodeblock> with. The key code is returned by the Inkey() function. To specify values for the array elements use #define constants from the file INKEY.CH.
<bNewCodeblock>
This parameter optionally specifies a code block to be executed when any key specified with <aInkey> is pressed. Passing NIL explicitly for <bCodeblock> releases a previously assigned code block for all keys in <aInkey>.

Return

The function returns always NIL.

Description

The function iterates the array <aInkey> and associates the code block <bCodeblock> with each Inkey() code contained in the array. This is equivalent to the following expression:

   bBlock := <a code block or NIL>
   AEval( aInkey, {|nKey| SetKey( nKey, bBlock ) } )

Info

See also:AEval(), Inkey(), RestSetkey(), SaveSetkey(), SetKey()
Category: Environment functions , Keyboard functions , xHarbour extensions
Source:rtl\setkey.c
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe