Redefines key codes or lock keys

        --> lAccepted


     <nOrgKeyValue>  Designates the original key code that is translated
     into the value of <nNewKeyValue>.

     <nNewKeyValue>  Designates a new key code for <nOrgKeyValue>.  If
     not specified, SETKXLAT() turns off the key translation designated by

     ()  Calling this function without a parameter uninstalls all of the key
     translations previously performed.


     SETKXLAT() returns .T. when the translation code is successfully
     installed, and .F. if a parameter contains errors or additional memory
     can not be allocated.  The number of allowable key code translations can
     be calculated as follows:

     maximum allocatable memory / 4


     With this function, keyed input can be translated or even switched off.
     Symbolic constants for the codes have been defined in the CTSCAN.CH
     include file.  The following formula applies to each key:

     cKeyValue = CHR(ASCII) + CHR(SCAN_CODE)

     Many key combinations have no ASCII equivalent.  In these cases, the
     CHR(ASCII) byte is 0.  However, some key and key combinations have a
     scan code, allowing the differentiation of keys with the same ASCII code
     (e.g.  the decimal point on the numeric key pad and the period in the
     alpha numeric field).

     Scan code 0 is returned when you input an ASCII code through the numeric
     key pad in the form Alt + <number>.

     When the function is called without <cNewKeyValue>, the translations
     specified in <cOrgKeyValue> are uninstalled.

     Calling the function without any parameters discards all existing


       The numeric coding previously used for the key codes is still

       All symbolic constants from the CA-Clipper file INKEY.CH can
        be used.

       A new translation for a key overwrites the previous one.

       Memory for the key code translations is allocated dynamically.


       Press the "A" and the keyboard returns the code of "B' (in
        reality you would seldom use this):

        SETKXLAT(KS_A, KS_B)                   // .T. if successful

       Translate the left arrow into the down arrow on the key pad.
        Both keys then return the same code:

        ? SETKXLAT(KS_LEFT, KS_DOWN)           // .T. if successful

       Turn the up arrow in the cursor control block off.  Key code:

        ? SETKXLAT(KS_DOWN, KS_DISABLE)        // .T. when successful

       Turn the up arrow back on:


       Uninstall all translations:


 To download this example - click here.