Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > INFLD > INFLD Parameters > funmap

INFLD Function Key Translation

Scroll Prev Top Next More

A-Shell Note: The only function key translation method which is strictly binary compatible between AMOS and A-Shell is the FIXTRN method. Tables created by FIXTRN.LIT under AMOS and FIXTRN.LIT under A-Shell are binary compatible, assuming equivalent terminal drivers. (The PCTDV and PCTDVG drivers used by A-Shell/Windows are function-key compatible with the AMOS AM65 driver.) SET PFK style translations are operationally compatible between A-Shell and AMOS but the tables themselves are not binary compatible.

When using the FIXTRN or SET PFK function key translation architectures, it is not possible for a single key to have both editing and command translations, so to get command EXITCODEs, you have to set the translation table up to do that directly. The procedure is to translate the function key to Ctrl+G (ASCII value 7) followed by the ASCII character whose value is the exitcode (negative) you want. For example, you might translate F5 to Ctrl+G Ctrl+E. Since the ASCII value of Ctrl+E is 5, INFLD will translate this sequence to exitcode -5. (Ctrl+G was chosen as the lead-in since it is generally reserved for some non-editing auxiliary function in other editing utilities. Prior to version 6.1 however, INFLD used Ctrl+B for this function.)

Since you have to translate all function keys directly to EXITCODEs in the translation table when using FIXTRN or SET PFK to make your tables, the funmap parameter only controls which function keys will have command translations enabled. The standard plan would be to set up the .IFX module to translate all the F keys (that could ever be used for command EXITCODEs) as discussed in the preceding paragraph. Then the funmap parameter is set at runtime to enable selected function keys, according to the table above. For example, to enable F1, F3, and F5, you would set funmap = 1 + 4 + 16. The main difference here between using the proprietary translation architecture module and either of the SET PFK or FIXTRN architectures is that with the proprietary format, merely setting the appropriate bit in the (funmap) parameter will enable the function key, while with the SET PFK/FIXTRN formats, you have to both set the appropriate bit in funmap and define the appropriate translation within the .IFX module.

There are two other possibilities for command function key EXITCODEs. One is to key them in directly from the keyboard at run time. From a programming standpoint, the funmap parameter is used exactly the same with the alternate keyboard sequences as with the SET PFK or FIXTRN translations.

The other is to use the new A-Shell "virtual" function key codes, which are typically associated with clicking the mouse on a field or button. These are defined using the sequence chr(7) + chr(250) + "###." where ### may be any number, 1 through 99999. This method allows you associate a (negative) exitcode value with just about every object or command in your entire application. See the hlpidx parameter for associating such sequences with inactive INFLD objects, and AUI_CONTROL for associating them with other kinds of control objects (buttons, static text fields, etc.)